mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Fix error in charProperties optimization.
Result should be 2, not 1. Use a static field to avoid this kind of error (though it might be slightly slower, depending on the compiler/toolchain).
This commit is contained in:
@@ -14,14 +14,15 @@ export class UnicodeGraphemeProvider implements IUnicodeVersionProvider {
|
||||
constructor() {
|
||||
}
|
||||
|
||||
static readonly plainNarrowProperties: UnicodeCharProperties
|
||||
= UnicodeService.createPropertyValue(UC.GRAPHEME_BREAK_Other, 1, false);
|
||||
|
||||
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;
|
||||
return UnicodeGraphemeProvider.plainNarrowProperties;
|
||||
}
|
||||
|
||||
let charInfo = UC.getInfo(codepoint);
|
||||
|
||||
Reference in New Issue
Block a user