MCPcopy
hub / github.com/HubSpot/messenger / charWidth

Function charWidth

docs/welcome/lib/executr/lib/CodeMirror/codemirror.js:1128–1136  ·  view source on GitHub ↗
(display)

Source from the content-addressed store, hash-verified

1126 }
1127
1128 function charWidth(display) {
1129 if (display.cachedCharWidth != null) return display.cachedCharWidth;
1130 var anchor = elt("span", "x");
1131 var pre = elt("pre", [anchor]);
1132 removeChildrenAndAdd(display.measure, pre);
1133 var width = anchor.offsetWidth;
1134 if (width > 2) display.cachedCharWidth = width;
1135 return width || 10;
1136 }
1137
1138 // OPERATIONS
1139

Callers 2

wrappingChangedFunction · 0.85
updateDocNoUndoFunction · 0.85

Calls 2

eltFunction · 0.85
removeChildrenAndAddFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…