本文整理汇总了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);
}