MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / addLineWidget

Function addLineWidget

static/js/codemirror/codemirror.js:3808–3824  ·  view source on GitHub ↗
(cm, handle, node, options)

Source from the content-addressed store, hash-verified

3806 }
3807
3808 function addLineWidget(cm, handle, node, options) {
3809 var widget = new LineWidget(cm, node, options);
3810 if (widget.noHScroll) cm.display.alignWidgets = true;
3811 changeLine(cm, handle, function(line) {
3812 (line.widgets || (line.widgets = [])).push(widget);
3813 widget.line = line;
3814 if (!lineIsHidden(cm.doc, line) || widget.showIfHidden) {
3815 var aboveVisible = heightAtLine(cm, line) < cm.display.scroller.scrollTop;
3816 updateLineHeight(line, line.height + widgetHeight(widget));
3817 if (aboveVisible)
3818 cm.curOp.updateScrollPos = {scrollTop: cm.doc.scrollTop + widget.height,
3819 scrollLeft: cm.doc.scrollLeft};
3820 }
3821 return true;
3822 });
3823 return widget;
3824 }
3825
3826 // LINE DATA STRUCTURE
3827

Callers 1

codemirror.jsFile · 0.85

Calls 6

changeLineFunction · 0.85
lineIsHiddenFunction · 0.85
heightAtLineFunction · 0.85
updateLineHeightFunction · 0.85
widgetHeightFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected