mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Optimize UnicodeGraphemeProvider for the ASCII case.
This commit is contained in:
@@ -15,6 +15,15 @@ export class UnicodeGraphemeProvider implements IUnicodeVersionProvider {
|
||||
}
|
||||
|
||||
public charProperties(codepoint: number, preceding: UnicodeCharProperties): UnicodeCharProperties {
|
||||
// Optimize the simple ASCII case, under the condition that
|
||||
// UnicodeService.extractCharKind(preceding) === GRAPHEME_BREAK_Other
|
||||
// (which also covers the case that preceding === 0).
|
||||
|
||||
if ((codepoint >= 32 && codepoint < 127) && (preceding >> 3) === 0) {
|
||||
// Inlined UnicodeService.createPropertyValue(GRAPHEME_BREAK_Other, 1, false)
|
||||
return 1;
|
||||
}
|
||||
|
||||
let charInfo = UC.getInfo(codepoint);
|
||||
let w = UC.infoToWidthInfo(charInfo);
|
||||
let shouldJoin = false;
|
||||
|
||||
Reference in New Issue
Block a user