本文整理匯總了TypeScript中vs/base/common/strings.isLowSurrogate函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript isLowSurrogate函數的具體用法?TypeScript isLowSurrogate怎麽用?TypeScript isLowSurrogate使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了isLowSurrogate函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: isLowSurrogate
public static isLowSurrogate(model: ICursorSimpleModel, lineNumber: number, charOffset: number): boolean {
let lineContent = model.getLineContent(lineNumber);
if (charOffset < 0 || charOffset >= lineContent.length) {
return false;
}
return strings.isLowSurrogate(lineContent.charCodeAt(charOffset));
}
示例2: positionLeftOf
private positionLeftOf(start: IPosition, model: ITextModel): Position {
let column = start.column;
let lineNumber = start.lineNumber;
if (column > model.getLineMinColumn(lineNumber)) {
if (isLowSurrogate(model.getLineContent(lineNumber).charCodeAt(column - 2))) {
// character before column is a low surrogate
column = column - 2;
} else {
column = column - 1;
}
} else if (lineNumber > 1) {
lineNumber = lineNumber - 1;
column = model.getLineMaxColumn(lineNumber);
}
return new Position(lineNumber, column);
}
示例3: isLowSurrogate
function isLowSurrogate(model: ICursorMoveHelperModel, lineNumber: number, column: number) {
return strings.isLowSurrogate(model.getLineContent(lineNumber).charCodeAt(column - 1));
}