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

Function addLineWidget

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

Source from the content-addressed store, hash-verified

4359 }
4360
4361 function addLineWidget(cm, handle, node, options) {
4362 var widget = new LineWidget(cm, node, options);
4363 if (widget.noHScroll) cm.display.alignWidgets = true;
4364 changeLine(cm, handle, function(line) {
4365 var widgets = line.widgets || (line.widgets = []);
4366 if (widget.insertAt == null) widgets.push(widget);
4367 else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget);
4368 widget.line = line;
4369 if (!lineIsHidden(cm.doc, line) || widget.showIfHidden) {
4370 var aboveVisible = heightAtLine(cm, line) < cm.doc.scrollTop;
4371 updateLineHeight(line, line.height + widgetHeight(widget));
4372 if (aboveVisible) addToScrollPos(cm, 0, widget.height);
4373 cm.curOp.forceUpdate = true;
4374 }
4375 return true;
4376 });
4377 return widget;
4378 }
4379
4380 // LINE DATA STRUCTURE
4381

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