@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xterm/xterm",
3
3
  "description": "Full xterm terminal, in your browser",
4
- "version": "5.4.0-beta.32",
4
+ "version": "5.4.0-beta.33",
5
5
  "main": "lib/xterm.js",
6
6
  "style": "css/xterm.css",
7
7
  "types": "typings/xterm.d.ts",
@@ -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
- return this._flat[cp] !== WidthCacheSettings.FLAT_UNSET
138
- ? this._flat[cp]
139
- : (this._flat[cp] = this._measure(c, 0));
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
- this._holey!.set(key, width);
155
+ if (width > 0) {
156
+ this._holey!.set(key, width);
157
+ }
151
158
  }
152
159
  return width;
153
160
  }