@xterm/xterm 5.4.0-beta.32 → 5.4.0-beta.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/xterm.js +1 -1
- package/lib/xterm.js.map +1 -1
- package/package.json +1 -1
- package/src/browser/renderer/dom/WidthCache.ts +11 -4
package/package.json
CHANGED
|
@@ -134,9 +134,14 @@ export class WidthCache implements IDisposable {
|
|
|
134
134
|
public get(c: string, bold: boolean | number, italic: boolean | number): number {
|
|
135
135
|
let cp = 0;
|
|
136
136
|
if (!bold && !italic && c.length === 1 && (cp = c.charCodeAt(0)) < WidthCacheSettings.FLAT_SIZE) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
if (this._flat[cp] !== WidthCacheSettings.FLAT_UNSET) {
|
|
138
|
+
return this._flat[cp];
|
|
139
|
+
}
|
|
140
|
+
const width = this._measure(c, 0);
|
|
141
|
+
if (width > 0) {
|
|
142
|
+
this._flat[cp] = width;
|
|
143
|
+
}
|
|
144
|
+
return width;
|
|
140
145
|
}
|
|
141
146
|
let key = c;
|
|
142
147
|
if (bold) key += 'B';
|
|
@@ -147,7 +152,9 @@ export class WidthCache implements IDisposable {
|
|
|
147
152
|
if (bold) variant |= FontVariant.BOLD;
|
|
148
153
|
if (italic) variant |= FontVariant.ITALIC;
|
|
149
154
|
width = this._measure(c, variant);
|
|
150
|
-
|
|
155
|
+
if (width > 0) {
|
|
156
|
+
this._holey!.set(key, width);
|
|
157
|
+
}
|
|
151
158
|
}
|
|
152
159
|
return width;
|
|
153
160
|
}
|