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

Function adjustContentWidth

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

Source from the content-addressed store, hash-verified

639 }
640
641 function adjustContentWidth(cm) {
642 var display = cm.display;
643 var width = measureChar(cm, display.maxLine, display.maxLine.text.length).left;
644 display.maxLineChanged = false;
645 var minWidth = Math.max(0, width + 3);
646 var maxScrollLeft = Math.max(0, display.sizer.offsetLeft + minWidth + scrollerCutOff - display.scroller.clientWidth);
647 display.sizer.style.minWidth = minWidth + "px";
648 if (maxScrollLeft < cm.doc.scrollLeft)
649 setScrollLeft(cm, Math.min(display.scroller.scrollLeft, maxScrollLeft), true);
650 }
651
652 function setDocumentHeight(cm, measure) {
653 cm.display.sizer.style.minHeight = cm.display.heightForcer.style.top = measure.docHeight + "px";

Callers 1

updateDisplayFunction · 0.85

Calls 2

measureCharFunction · 0.70
setScrollLeftFunction · 0.70

Tested by

no test coverage detected