MCPcopy Index your code
hub / github.com/csev/py4e / updateLineGutter

Function updateLineGutter

tools/pythonauto/static/codemirrorepl/codemirror.js:831–856  ·  view source on GitHub ↗
(cm, lineView, lineN, dims)

Source from the content-addressed store, hash-verified

829 }
830
831 function updateLineGutter(cm, lineView, lineN, dims) {
832 if (lineView.gutter) {
833 lineView.node.removeChild(lineView.gutter);
834 lineView.gutter = null;
835 }
836 var markers = lineView.line.gutterMarkers;
837 if (cm.options.lineNumbers || markers) {
838 var wrap = ensureLineWrapped(lineView);
839 var gutterWrap = lineView.gutter =
840 wrap.insertBefore(elt("div", null, "CodeMirror-gutter-wrapper", "position: absolute; left: " +
841 (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"),
842 lineView.text);
843 if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"]))
844 lineView.lineNumber = gutterWrap.appendChild(
845 elt("div", lineNumberFor(cm.options, lineN),
846 "CodeMirror-linenumber CodeMirror-gutter-elt",
847 "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: "
848 + cm.display.lineNumInnerWidth + "px"));
849 if (markers) for (var k = 0; k < cm.options.gutters.length; ++k) {
850 var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];
851 if (found)
852 gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " +
853 dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px"));
854 }
855 }
856 }
857
858 function updateLineWidgets(lineView, dims) {
859 if (lineView.alignable) lineView.alignable = null;

Callers 2

updateLineForChangesFunction · 0.85
buildLineElementFunction · 0.85

Calls 6

ensureLineWrappedFunction · 0.85
eltFunction · 0.70
lineNumberForFunction · 0.70
removeChildMethod · 0.45
insertBeforeMethod · 0.45
appendChildMethod · 0.45

Tested by

no test coverage detected