本文整理匯總了TypeScript中vs/editor/common/controller/cursorCommon.CursorColumns.isInsideSurrogatePair方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript CursorColumns.isInsideSurrogatePair方法的具體用法?TypeScript CursorColumns.isInsideSurrogatePair怎麽用?TypeScript CursorColumns.isInsideSurrogatePair使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/editor/common/controller/cursorCommon.CursorColumns
的用法示例。
在下文中一共展示了CursorColumns.isInsideSurrogatePair方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: down
public static down(config: CursorConfiguration, model: ICursorSimpleModel, lineNumber: number, column: number, leftoverVisibleColumns: number, count: number, allowMoveOnLastLine: boolean): CursorPosition {
const currentVisibleColumn = CursorColumns.visibleColumnFromColumn(model.getLineContent(lineNumber), column, config.tabSize) + leftoverVisibleColumns;
lineNumber = lineNumber + count;
let lineCount = model.getLineCount();
if (lineNumber > lineCount) {
lineNumber = lineCount;
if (allowMoveOnLastLine) {
column = model.getLineMaxColumn(lineNumber);
} else {
column = Math.min(model.getLineMaxColumn(lineNumber), column);
if (CursorColumns.isInsideSurrogatePair(model, lineNumber, column)) {
column = column - 1;
}
}
} else {
column = CursorColumns.columnFromVisibleColumn2(config, model, lineNumber, currentVisibleColumn);
if (CursorColumns.isInsideSurrogatePair(model, lineNumber, column)) {
column = column - 1;
}
}
leftoverVisibleColumns = currentVisibleColumn - CursorColumns.visibleColumnFromColumn(model.getLineContent(lineNumber), column, config.tabSize);
return new CursorPosition(lineNumber, column, leftoverVisibleColumns);
}