MCPcopy
hub / github.com/witheve/Eve / updateGutters

Function updateGutters

src/codemirror.js:313–326  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

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

Callers 2

CodeMirrorFunction · 0.85
guttersChangedFunction · 0.85

Calls 3

removeChildrenFunction · 0.85
eltFunction · 0.85
updateGutterSpaceFunction · 0.85

Tested by

no test coverage detected