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

Function startOperation

static/editor.md/lib/codemirror/lib/codemirror.js:2883–2908  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

2881 var nextOpId = 0;
2882 // Start a new operation.
2883 function startOperation(cm) {
2884 cm.curOp = {
2885 cm: cm,
2886 viewChanged: false, // Flag that indicates that lines might need to be redrawn
2887 startHeight: cm.doc.height, // Used to detect need to update scrollbar
2888 forceUpdate: false, // Used to force a redraw
2889 updateInput: null, // Whether to reset the input textarea
2890 typing: false, // Whether this reset should be careful to leave existing text (for compositing)
2891 changeObjs: null, // Accumulated changes, for firing change events
2892 cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on
2893 cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already
2894 selectionChanged: false, // Whether the selection needs to be redrawn
2895 updateMaxLine: false, // Set when the widest line needs to be determined anew
2896 scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet
2897 scrollToPos: null, // Used to scroll to a specific position
2898 id: ++nextOpId // Unique ID
2899 };
2900 if (operationGroup) {
2901 operationGroup.ops.push(cm.curOp);
2902 } else {
2903 cm.curOp.ownsGroup = operationGroup = {
2904 ops: [cm.curOp],
2905 delayedCallbacks: []
2906 };
2907 }
2908 }
2909
2910 function fireCallbacksForOps(group) {
2911 // Calls delayed callbacks and cursorActivity handlers until no

Callers 6

CodeMirrorFunction · 0.70
runInOpFunction · 0.70
operationFunction · 0.70
methodOpFunction · 0.70
docMethodOpFunction · 0.70
codemirror.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected