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

Function alignHorizontally

tools/pythonauto/static/codemirror/codemirror.js:386–396  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

384 // LINE NUMBERS
385
386 function alignHorizontally(cm) {
387 var display = cm.display;
388 if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;
389 var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;
390 var gutterW = display.gutters.offsetWidth, l = comp + "px";
391 for (var n = display.lineDiv.firstChild; n; n = n.nextSibling) if (n.alignable) {
392 for (var i = 0, a = n.alignable; i < a.length; ++i) a[i].style.left = l;
393 }
394 if (cm.options.fixedGutter)
395 display.gutters.style.left = (comp + gutterW) + "px";
396 }
397
398 function maybeUpdateLineNumberWidth(cm) {
399 if (!cm.options.lineNumbers) return false;

Callers 3

guttersChangedFunction · 0.70
endOperationFunction · 0.70
setScrollLeftFunction · 0.70

Calls 1

compensateForHScrollFunction · 0.70

Tested by

no test coverage detected