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

Method clear

lib/web/CodeMirror/src/model/line_widget.js:21–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19 }
20
21 clear() {
22 let cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line)
23 if (no == null || !ws) return
24 for (let i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1)
25 if (!ws.length) line.widgets = null
26 let height = widgetHeight(this)
27 updateLineHeight(line, Math.max(0, line.height - height))
28 if (cm) {
29 runInOp(cm, () => {
30 adjustScrollWhenAboveVisible(cm, line, -height)
31 regLineChange(cm, no, "widget")
32 })
33 signalLater(cm, "lineWidgetCleared", cm, this, no)
34 }
35 }
36
37 changed() {
38 let oldH = this.height, cm = this.doc.cm, line = this.line

Callers

nothing calls this directly

Calls 8

lineNoFunction · 0.90
widgetHeightFunction · 0.90
updateLineHeightFunction · 0.90
runInOpFunction · 0.90
regLineChangeFunction · 0.90
signalLaterFunction · 0.90
maxMethod · 0.45

Tested by

no test coverage detected