MCPcopy Create free account
hub / github.com/TruthHun/BookStack / endOperation_R2

Function endOperation_R2

static/editor.md/lib/codemirror/lib/codemirror.js:2973–2992  ·  view source on GitHub ↗
(op)

Source from the content-addressed store, hash-verified

2971 }
2972
2973 function endOperation_R2(op) {
2974 var cm = op.cm, display = cm.display;
2975 if (op.updatedDisplay) updateHeightsInViewport(cm);
2976
2977 op.barMeasure = measureForScrollbars(cm);
2978
2979 // If the max line changed since it was last measured, measure it,
2980 // and ensure the document's width matches it.
2981 // updateDisplay_W2 will use these properties to do the actual resizing
2982 if (display.maxLineChanged && !cm.options.lineWrapping) {
2983 op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;
2984 cm.display.sizerWidth = op.adjustWidthTo;
2985 op.barMeasure.scrollWidth =
2986 Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);
2987 op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));
2988 }
2989
2990 if (op.updatedDisplay || op.selectionChanged)
2991 op.preparedSelection = display.input.prepareSelection();
2992 }
2993
2994 function endOperation_W2(op) {
2995 var cm = op.cm;

Callers 1

endOperationsFunction · 0.70

Calls 5

updateHeightsInViewportFunction · 0.70
measureForScrollbarsFunction · 0.70
measureCharFunction · 0.70
scrollGapFunction · 0.70
displayWidthFunction · 0.70

Tested by

no test coverage detected