當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。