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

Function updateLineForChanges

lib/web/CodeMirror/src/display/update_line.js:10–19  ·  view source on GitHub ↗
(cm, lineView, lineN, dims)

Source from the content-addressed store, hash-verified

8// lineView.changes. This updates the relevant part of the line's
9// DOM structure.
10export function updateLineForChanges(cm, lineView, lineN, dims) {
11 for (let j = 0; j < lineView.changes.length; j++) {
12 let type = lineView.changes[j]
13 if (type == "text") updateLineText(cm, lineView)
14 else if (type == "gutter") updateLineGutter(cm, lineView, lineN, dims)
15 else if (type == "class") updateLineClasses(cm, lineView)
16 else if (type == "widget") updateLineWidgets(cm, lineView, dims)
17 }
18 lineView.changes = null
19}
20
21// Lines with gutter elements, widgets or a background class need to
22// be wrapped, and have the extra elements added to the wrapper div

Callers 2

patchDisplayFunction · 0.90
prepareMeasureForLineFunction · 0.90

Calls 4

updateLineTextFunction · 0.70
updateLineGutterFunction · 0.70
updateLineClassesFunction · 0.70
updateLineWidgetsFunction · 0.70

Tested by

no test coverage detected