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

Function updateLine

external/.scrollLibs.js:2796–2813  ·  view source on GitHub ↗
(line, text, markedSpans, estimateHeight)

Source from the content-addressed store, hash-verified

2794 // invalidates cached information and tries to re-estimate the
2795 // line's height.
2796 function updateLine(line, text, markedSpans, estimateHeight) {
2797 line.text = text
2798 if (line.stateAfter) {
2799 line.stateAfter = null
2800 }
2801 if (line.styles) {
2802 line.styles = null
2803 }
2804 if (line.order != null) {
2805 line.order = null
2806 }
2807 detachMarkedSpans(line)
2808 attachMarkedSpans(line, markedSpans)
2809 var estHeight = estimateHeight ? estimateHeight(line) : 1
2810 if (estHeight != line.height) {
2811 updateLineHeight(line, estHeight)
2812 }
2813 }
2814
2815 // Detach a line from the document tree and its markers.
2816 function cleanUpLine(line) {

Callers 1

updateFunction · 0.85

Calls 4

detachMarkedSpansFunction · 0.85
attachMarkedSpansFunction · 0.85
estimateHeightFunction · 0.85
updateLineHeightFunction · 0.85

Tested by

no test coverage detected