MCPcopy Index your code
hub / github.com/csev/py4e / addLineWidget

Function addLineWidget

tools/pythonauto/static/codemirrorepl/codemirror.js:5471–5488  ·  view source on GitHub ↗
(cm, handle, node, options)

Source from the content-addressed store, hash-verified

5469 }
5470
5471 function addLineWidget(cm, handle, node, options) {
5472 var widget = new LineWidget(cm, node, options);
5473 if (widget.noHScroll) cm.display.alignWidgets = true;
5474 changeLine(cm, handle, "widget", function(line) {
5475 var widgets = line.widgets || (line.widgets = []);
5476 if (widget.insertAt == null) widgets.push(widget);
5477 else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget);
5478 widget.line = line;
5479 if (!lineIsHidden(cm.doc, line)) {
5480 var aboveVisible = heightAtLine(line) < cm.doc.scrollTop;
5481 updateLineHeight(line, line.height + widgetHeight(widget));
5482 if (aboveVisible) addToScrollPos(cm, null, widget.height);
5483 cm.curOp.forceUpdate = true;
5484 }
5485 return true;
5486 });
5487 return widget;
5488 }
5489
5490 // LINE DATA STRUCTURE
5491

Callers 1

codemirror.jsFile · 0.70

Calls 6

changeLineFunction · 0.70
lineIsHiddenFunction · 0.70
heightAtLineFunction · 0.70
updateLineHeightFunction · 0.70
widgetHeightFunction · 0.70
addToScrollPosFunction · 0.70

Tested by

no test coverage detected