本文整理匯總了TypeScript中vs/editor/common/core/selection.Selection.createSelection方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Selection.createSelection方法的具體用法?TypeScript Selection.createSelection怎麽用?TypeScript Selection.createSelection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/editor/common/core/selection.Selection
的用法示例。
在下文中一共展示了Selection.createSelection方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test
test('Get selected changes test - one change partially seleceted with multiple selections', () => {
var selections: Selection[] = [];
selections.push(Selection.createSelection(2, 2, 5, 5), Selection.createSelection(7, 2, 9, 1));
var changes: IChange[] = [];
changes.push(createChange(1, 15, 1, 10), createChange(120, 127, 122, 126));
var result = getSelectedChanges(changes, selections);
var expected: IChange[] = [];
expected.push(createChange(2, 5, 1, 10), createChange(7, 9, 1, 10));
changesEqual(result, expected);
});
示例2: computeCursorState
public computeCursorState(model:editorCommon.ITokenizedModel, helper: editorCommon.ICursorStateComputerData): Selection {
var inverseEditOperations = helper.getInverseEditOperations();
var srcRange = inverseEditOperations[inverseEditOperations.length - 1].range;
return Selection.createSelection(
srcRange.endLineNumber,
srcRange.endColumn,
srcRange.endLineNumber,
srcRange.endColumn
);
}
示例3: computeCursorState
public computeCursorState(model:EditorCommon.ITokenizedModel, helper: EditorCommon.ICursorStateComputerData):EditorCommon.IEditorSelection {
var inverseEditOperations = helper.getInverseEditOperations();
var srcRange = inverseEditOperations[0].range;
return Selection.createSelection(
srcRange.endLineNumber,
this.restoreCursorToColumn,
srcRange.endLineNumber,
this.restoreCursorToColumn
);
}
示例4: computeCursorState
public computeCursorState(model:editorCommon.ITokenizedModel, helper: editorCommon.ICursorStateComputerData):Selection {
var inverseEditOperations = helper.getInverseEditOperations();
var srcRange = inverseEditOperations[0].range;
if (!this._originalSelection.isEmpty()) {
// Preserve selection and extends to typed text
return Selection.createSelection(
srcRange.endLineNumber,
srcRange.endColumn - this._text.length,
srcRange.endLineNumber,
srcRange.endColumn
);
}
return Selection.createSelection(
srcRange.endLineNumber,
Math.min(this._originalSelection.positionColumn, srcRange.endColumn),
srcRange.endLineNumber,
Math.min(this._originalSelection.positionColumn, srcRange.endColumn)
);
}