()
| 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() { |
no test coverage detected