MCPcopy Create free account
hub / github.com/breck7/scroll / updateGutters

Function updateGutters

external/.scrollLibs.js:6107–6122  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

6105 // Rebuild the gutter elements, ensure the margin to the left of the
6106 // code matches their width.
6107 function updateGutters(cm) {
6108 var gutters = cm.display.gutters,
6109 specs = cm.options.gutters
6110 removeChildren(gutters)
6111 var i = 0
6112 for (; i < specs.length; ++i) {
6113 var gutterClass = specs[i]
6114 var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass))
6115 if (gutterClass == "CodeMirror-linenumbers") {
6116 cm.display.lineGutter = gElt
6117 gElt.style.width = (cm.display.lineNumWidth || 1) + "px"
6118 }
6119 }
6120 gutters.style.display = i ? "" : "none"
6121 updateGutterSpace(cm)
6122 }
6123
6124 // Make sure the gutters options contains the element
6125 // "CodeMirror-linenumbers" when the lineNumbers option is true.

Callers 2

guttersChangedFunction · 0.85
CodeMirrorFunction · 0.85

Calls 3

removeChildrenFunction · 0.85
eltFunction · 0.85
updateGutterSpaceFunction · 0.85

Tested by

no test coverage detected