MCPcopy
hub / github.com/nwutils/nw-sample-apps / endOperation

Function endOperation

mini-code-edit/cm/lib/codemirror.js:1864–1892  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1862 changes = []; selectionChanged = false; callbacks = [];
1863 }
1864 function endOperation() {
1865 var reScroll = false, updated;
1866 if (maxLengthChanged) computeMaxLength();
1867 if (selectionChanged) reScroll = !scrollCursorIntoView();
1868 if (changes.length) updated = updateDisplay(changes, true);
1869 else {
1870 if (selectionChanged) updateSelection();
1871 if (gutterDirty) updateGutter();
1872 }
1873 if (reScroll) scrollCursorIntoView();
1874 if (selectionChanged) {scrollEditorIntoView(); restartBlink();}
1875
1876 if (focused && !leaveInputAlone &&
1877 (updateInput === true || (updateInput !== false && selectionChanged)))
1878 resetInput(userSelChange);
1879
1880 if (selectionChanged && options.matchBrackets)
1881 setTimeout(operation(function() {
1882 if (bracketHighlighted) {bracketHighlighted(); bracketHighlighted = null;}
1883 if (posEq(sel.from, sel.to)) matchBrackets(false);
1884 }), 20);
1885 var tc = textChanged, cbs = callbacks; // these can be reset by callbacks
1886 if (selectionChanged && options.onCursorActivity)
1887 options.onCursorActivity(instance);
1888 if (tc && options.onChange && instance)
1889 options.onChange(instance, tc);
1890 for (var i = 0; i < cbs.length; ++i) cbs[i](instance);
1891 if (updated && options.onUpdate) options.onUpdate(instance);
1892 }
1893 var nestedOperation = 0;
1894 function operation(f) {
1895 return function() {

Callers 3

slowPollFunction · 0.85
pFunction · 0.85
operationFunction · 0.85

Calls 11

computeMaxLengthFunction · 0.85
scrollCursorIntoViewFunction · 0.85
updateDisplayFunction · 0.85
updateSelectionFunction · 0.85
updateGutterFunction · 0.85
scrollEditorIntoViewFunction · 0.85
restartBlinkFunction · 0.85
resetInputFunction · 0.85
operationFunction · 0.85
posEqFunction · 0.85
matchBracketsFunction · 0.70

Tested by

no test coverage detected