(doc, handle, node, options)
| 5769 | } |
| 5770 | |
| 5771 | function addLineWidget(doc, handle, node, options) { |
| 5772 | var widget = new LineWidget(doc, node, options); |
| 5773 | var cm = doc.cm; |
| 5774 | if (cm && widget.noHScroll) { cm.display.alignWidgets = true; } |
| 5775 | changeLine(doc, handle, "widget", function (line) { |
| 5776 | var widgets = line.widgets || (line.widgets = []); |
| 5777 | if (widget.insertAt == null) { widgets.push(widget); } |
| 5778 | else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); } |
| 5779 | widget.line = line; |
| 5780 | if (cm && !lineIsHidden(doc, line)) { |
| 5781 | var aboveVisible = heightAtLine(line) < doc.scrollTop; |
| 5782 | updateLineHeight(line, line.height + widgetHeight(widget)); |
| 5783 | if (aboveVisible) { addToScrollTop(cm, widget.height); } |
| 5784 | cm.curOp.forceUpdate = true; |
| 5785 | } |
| 5786 | return true |
| 5787 | }); |
| 5788 | if (cm) { signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)); } |
| 5789 | return widget |
| 5790 | } |
| 5791 | |
| 5792 | // TEXTMARKERS |
| 5793 |
no test coverage detected