MCPcopy Create free account
hub / github.com/sql-js/sql.js / addLineWidget

Function addLineWidget

GUI/codemirror/lib/codemirror.js:5514–5531  ·  view source on GitHub ↗
(cm, handle, node, options)

Source from the content-addressed store, hash-verified

5512 }
5513
5514 function addLineWidget(cm, handle, node, options) {
5515 var widget = new LineWidget(cm, node, options);
5516 if (widget.noHScroll) cm.display.alignWidgets = true;
5517 changeLine(cm, handle, "widget", function(line) {
5518 var widgets = line.widgets || (line.widgets = []);
5519 if (widget.insertAt == null) widgets.push(widget);
5520 else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget);
5521 widget.line = line;
5522 if (!lineIsHidden(cm.doc, line)) {
5523 var aboveVisible = heightAtLine(line) < cm.doc.scrollTop;
5524 updateLineHeight(line, line.height + widgetHeight(widget));
5525 if (aboveVisible) addToScrollPos(cm, null, widget.height);
5526 cm.curOp.forceUpdate = true;
5527 }
5528 return true;
5529 });
5530 return widget;
5531 }
5532
5533 // LINE DATA STRUCTURE
5534

Callers 1

codemirror.jsFile · 0.85

Calls 6

changeLineFunction · 0.85
lineIsHiddenFunction · 0.85
heightAtLineFunction · 0.85
updateLineHeightFunction · 0.85
widgetHeightFunction · 0.85
addToScrollPosFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…