MCPcopy Create free account
hub / github.com/breck7/scroll / runInOp

Function runInOp

external/.scrollLibs.js:5519–5529  ·  view source on GitHub ↗
(cm, f)

Source from the content-addressed store, hash-verified

5517
5518 // Run the given function in an operation
5519 function runInOp(cm, f) {
5520 if (cm.curOp) {
5521 return f()
5522 }
5523 startOperation(cm)
5524 try {
5525 return f()
5526 } finally {
5527 endOperation(cm)
5528 }
5529 }
5530 // Wraps a function in an operation. Returns the wrapped function.
5531 function operation(cm, f) {
5532 return function () {

Callers 6

highlightWorkerFunction · 0.85
directionChangedFunction · 0.85
.scrollLibs.jsFile · 0.85
deleteNearSelectionFunction · 0.85
handlePasteFunction · 0.85
addEditorMethodsFunction · 0.85

Calls 3

startOperationFunction · 0.85
endOperationFunction · 0.85
fFunction · 0.70

Tested by

no test coverage detected