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

Function updateLine

lib/web/CodeMirror/src/line/line_data.js:30–39  ·  view source on GitHub ↗
(line, text, markedSpans, estimateHeight)

Source from the content-addressed store, hash-verified

28// invalidates cached information and tries to re-estimate the
29// line's height.
30export function updateLine(line, text, markedSpans, estimateHeight) {
31 line.text = text
32 if (line.stateAfter) line.stateAfter = null
33 if (line.styles) line.styles = null
34 if (line.order != null) line.order = null
35 detachMarkedSpans(line)
36 attachMarkedSpans(line, markedSpans)
37 let estHeight = estimateHeight ? estimateHeight(line) : 1
38 if (estHeight != line.height) updateLineHeight(line, estHeight)
39}
40
41// Detach a line from the document tree and its markers.
42export function cleanUpLine(line) {

Callers 1

updateFunction · 0.90

Calls 4

detachMarkedSpansFunction · 0.90
attachMarkedSpansFunction · 0.90
updateLineHeightFunction · 0.90
estimateHeightFunction · 0.50

Tested by

no test coverage detected