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

Function methodOp

external/.scrollLibs.js:5546–5558  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

5544 // Used to add methods to editor and doc instances, wrapping them in
5545 // operations.
5546 function methodOp(f) {
5547 return function () {
5548 if (this.curOp) {
5549 return f.apply(this, arguments)
5550 }
5551 startOperation(this)
5552 try {
5553 return f.apply(this, arguments)
5554 } finally {
5555 endOperation(this)
5556 }
5557 }
5558 }
5559 function docMethodOp(f) {
5560 return function () {
5561 var cm = this.cm

Callers 1

addEditorMethodsFunction · 0.85

Calls 2

startOperationFunction · 0.85
endOperationFunction · 0.85

Tested by

no test coverage detected