当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ICursorSimpleModel.getLineFirstNonWhitespaceColumn方法代码示例

本文整理汇总了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;
	}
开发者ID:yuit,项目名称:vscode,代码行数:14,代码来源:oneCursor.ts

示例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;
	}
开发者ID:rebornix,项目名称:vscode,代码行数:12,代码来源:cursorMoveHelper.ts

示例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);
	}
开发者ID:sandy081,项目名称:vscode,代码行数:15,代码来源:cursorMoveOperations.ts

示例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);
	}
开发者ID:DonJayamanne,项目名称:vscode,代码行数:16,代码来源:cursorMoveOperations.ts


注:本文中的vs/editor/common/controller/cursorCommon.ICursorSimpleModel.getLineFirstNonWhitespaceColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。