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

Function changeLine

external/.scrollLibs.js:7484–7499  ·  view source on GitHub ↗
(doc, handle, changeType, op)

Source from the content-addressed store, hash-verified

7482 // returning the number and optionally registering the line as
7483 // changed.
7484 function changeLine(doc, handle, changeType, op) {
7485 var no = handle,
7486 line = handle
7487 if (typeof handle == "number") {
7488 line = getLine(doc, clipLine(doc, handle))
7489 } else {
7490 no = lineNo(handle)
7491 }
7492 if (no == null) {
7493 return null
7494 }
7495 if (op(line, no) && doc.cm) {
7496 regLineChange(doc.cm, no, changeType)
7497 }
7498 return line
7499 }
7500
7501 // The document is represented as a BTree consisting of leaves, with
7502 // chunk of lines in them, and branches, with up to ten leaves or

Callers 2

addLineWidgetFunction · 0.85
.scrollLibs.jsFile · 0.85

Calls 4

getLineFunction · 0.85
lineNoFunction · 0.85
regLineChangeFunction · 0.85
clipLineFunction · 0.70

Tested by

no test coverage detected