MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getStringCellWidth

Method getStringCellWidth

src/server/web/public/terminal.js:5905–5920  ·  view source on GitHub ↗
(e3)

Source from the content-addressed store, hash-verified

5903 this._providers[e3.version] = e3;
5904 }
5905 wcwidth(e3) {
5906 return this._activeProvider.wcwidth(e3);
5907 }
5908 getStringCellWidth(e3) {
5909 let t3 = 0, i3 = 0;
5910 const s3 = e3.length;
5911 for (let r2 = 0; r2 < s3; ++r2) {
5912 let o = e3.charCodeAt(r2);
5913 if (55296 <= o && o <= 56319) {
5914 if (++r2 >= s3) return t3 + this.wcwidth(o);
5915 const i4 = e3.charCodeAt(r2);
5916 56320 <= i4 && i4 <= 57343 ? o = 1024 * (o - 55296) + i4 - 56320 + 65536 : t3 += this.wcwidth(i4);
5917 }
5918 const a = this.charProperties(o, i3);
5919 let h = n.extractWidth(a);
5920 n.extractShouldJoin(a) && (h -= n.extractWidth(i3)), t3 += h, i3 = a;
5921 }
5922 return t3;
5923 }

Callers 1

_drawToCacheMethod · 0.80

Calls 4

wcwidthMethod · 0.95
charPropertiesMethod · 0.95
extractWidthMethod · 0.80
extractShouldJoinMethod · 0.80

Tested by

no test coverage detected