本文整理匯總了TypeScript中vs/editor/common/controller/cursorCommon.ICursorSimpleModel.getLineFirstNonWhitespaceColumn方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ICursorSimpleModel.getLineFirstNonWhitespaceColumn方法的具體用法?TypeScript ICursorSimpleModel.getLineFirstNonWhitespaceColumn怎麽用?TypeScript ICursorSimpleModel.getLineFirstNonWhitespaceColumn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/editor/common/controller/cursorCommon.ICursorSimpleModel
的用法示例。
在下文中一共展示了ICursorSimpleModel.getLineFirstNonWhitespaceColumn方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: getNearestRevealViewPositionInViewport
public getNearestRevealViewPositionInViewport(): Position {
const position = this.viewState.position;
const revealRange = this.getRevealViewLinesRangeInViewport();
if (position.lineNumber < revealRange.startLineNumber) {
return new Position(revealRange.startLineNumber, this.viewModel.getLineFirstNonWhitespaceColumn(revealRange.startLineNumber));
}
if (position.lineNumber > revealRange.endLineNumber) {
return new Position(revealRange.endLineNumber, this.viewModel.getLineFirstNonWhitespaceColumn(revealRange.endLineNumber));
}
return position;
}
示例2: getColumnAtBeginningOfLine
public static getColumnAtBeginningOfLine(model: ICursorSimpleModel, lineNumber: number, column: number): number {
var firstNonBlankColumn = model.getLineFirstNonWhitespaceColumn(lineNumber) || 1;
var minColumn = model.getLineMinColumn(lineNumber);
if (column !== minColumn && column <= firstNonBlankColumn) {
column = minColumn;
} else {
column = firstNonBlankColumn;
}
return column;
}
示例3: moveToBeginningOfLine
public static moveToBeginningOfLine(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean): SingleMoveOperationResult {
let lineNumber = cursor.selection.startLineNumber;
let minColumn = model.getLineMinColumn(lineNumber);
let firstNonBlankColumn = model.getLineFirstNonWhitespaceColumn(lineNumber) || minColumn;
let column: number;
if (cursor.selection.startColumn === firstNonBlankColumn) {
column = minColumn;
} else {
column = firstNonBlankColumn;
}
return SingleMoveOperationResult.fromMove(cursor, inSelectionMode, lineNumber, column, 0, true, CursorChangeReason.Explicit);
}
示例4: moveToBeginningOfLine
public static moveToBeginningOfLine(config: CursorConfiguration, model: ICursorSimpleModel, cursor: SingleCursorState, inSelectionMode: boolean): SingleCursorState {
let lineNumber = cursor.position.lineNumber;
let minColumn = model.getLineMinColumn(lineNumber);
let firstNonBlankColumn = model.getLineFirstNonWhitespaceColumn(lineNumber) || minColumn;
let column: number;
let relevantColumnNumber = cursor.position.column;
if (relevantColumnNumber === firstNonBlankColumn) {
column = minColumn;
} else {
column = firstNonBlankColumn;
}
return cursor.move(inSelectionMode, lineNumber, column, 0);
}