本文整理匯總了TypeScript中vs/editor/common/core/selection.Selection.getDirection方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Selection.getDirection方法的具體用法?TypeScript Selection.getDirection怎麽用?TypeScript Selection.getDirection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/editor/common/core/selection.Selection
的用法示例。
在下文中一共展示了Selection.getDirection方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: getEditOperations
public getEditOperations(model: ITextModel, builder: editorCommon.IEditOperationBuilder): void {
let s = this._selection;
this._startLineNumberDelta = 0;
this._endLineNumberDelta = 0;
if (s.startLineNumber < s.endLineNumber && s.endColumn === 1) {
this._endLineNumberDelta = 1;
s = s.setEndPosition(s.endLineNumber - 1, model.getLineMaxColumn(s.endLineNumber - 1));
}
let sourceLines: string[] = [];
for (let i = s.startLineNumber; i <= s.endLineNumber; i++) {
sourceLines.push(model.getLineContent(i));
}
const sourceText = sourceLines.join('\n');
if (sourceText === '') {
// Duplicating empty line
if (this._isCopyingDown) {
this._startLineNumberDelta++;
this._endLineNumberDelta++;
}
}
if (!this._isCopyingDown) {
builder.addEditOperation(new Range(s.endLineNumber, model.getLineMaxColumn(s.endLineNumber), s.endLineNumber, model.getLineMaxColumn(s.endLineNumber)), '\n' + sourceText);
} else {
builder.addEditOperation(new Range(s.startLineNumber, 1, s.startLineNumber, 1), sourceText + '\n');
}
this._selectionId = builder.trackSelection(s);
this._selectionDirection = this._selection.getDirection();
}