(cm)
| 21 | let nextOpId = 0 |
| 22 | // Start a new operation. |
| 23 | export function startOperation(cm) { |
| 24 | cm.curOp = { |
| 25 | cm: cm, |
| 26 | viewChanged: false, // Flag that indicates that lines might need to be redrawn |
| 27 | startHeight: cm.doc.height, // Used to detect need to update scrollbar |
| 28 | forceUpdate: false, // Used to force a redraw |
| 29 | updateInput: 0, // Whether to reset the input textarea |
| 30 | typing: false, // Whether this reset should be careful to leave existing text (for compositing) |
| 31 | changeObjs: null, // Accumulated changes, for firing change events |
| 32 | cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on |
| 33 | cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already |
| 34 | selectionChanged: false, // Whether the selection needs to be redrawn |
| 35 | updateMaxLine: false, // Set when the widest line needs to be determined anew |
| 36 | scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet |
| 37 | scrollToPos: null, // Used to scroll to a specific position |
| 38 | focus: false, |
| 39 | id: ++nextOpId // Unique ID |
| 40 | } |
| 41 | pushOperation(cm.curOp) |
| 42 | } |
| 43 | |
| 44 | // Finish an operation, updating the display and signalling delayed events |
| 45 | export function endOperation(cm) { |
no test coverage detected