MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / regLineChange

Function regLineChange

lib/web/CodeMirror/src/display/view_tracking.js:78–89  ·  view source on GitHub ↗
(cm, line, type)

Source from the content-addressed store, hash-verified

76// Register a change to a single line. Type must be one of "text",
77// "gutter", "class", "widget"
78export function regLineChange(cm, line, type) {
79 cm.curOp.viewChanged = true
80 let display = cm.display, ext = cm.display.externalMeasured
81 if (ext && line >= ext.lineN && line < ext.lineN + ext.size)
82 display.externalMeasured = null
83
84 if (line < display.viewFrom || line >= display.viewTo) return
85 let lineView = display.view[findViewIndex(cm, line)]
86 if (lineView.node == null) return
87 let arr = lineView.changes || (lineView.changes = [])
88 if (indexOf(arr, type) == -1) arr.push(type)
89}
90
91// Clear the view.
92export function resetView(cm) {

Callers 8

highlightWorkerFunction · 0.90
clearMethod · 0.90
markTextFunction · 0.90
shiftDocFunction · 0.90
changeLineFunction · 0.90
clearMethod · 0.90
methods.jsFile · 0.90

Calls 3

findViewIndexFunction · 0.90
indexOfFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected