MCPcopy
hub / github.com/csev/py4e / updateGutters

Function updateGutters

tools/pythonauto/static/codemirrorepl/codemirror.js:319–332  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

317 // Rebuild the gutter elements, ensure the margin to the left of the
318 // code matches their width.
319 function updateGutters(cm) {
320 var gutters = cm.display.gutters, specs = cm.options.gutters;
321 removeChildren(gutters);
322 for (var i = 0; i < specs.length; ++i) {
323 var gutterClass = specs[i];
324 var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass));
325 if (gutterClass == "CodeMirror-linenumbers") {
326 cm.display.lineGutter = gElt;
327 gElt.style.width = (cm.display.lineNumWidth || 1) + "px";
328 }
329 }
330 gutters.style.display = i ? "" : "none";
331 updateGutterSpace(cm);
332 }
333
334 function updateGutterSpace(cm) {
335 var width = cm.display.gutters.offsetWidth;

Callers 2

CodeMirrorFunction · 0.70
guttersChangedFunction · 0.70

Calls 4

updateGutterSpaceFunction · 0.85
removeChildrenFunction · 0.70
eltFunction · 0.70
appendChildMethod · 0.45

Tested by

no test coverage detected