(doc, handle, node, options)
| 6686 | } |
| 6687 | |
| 6688 | function addLineWidget(doc, handle, node, options) { |
| 6689 | var widget = new LineWidget(doc, node, options); |
| 6690 | var cm = doc.cm; |
| 6691 | if (cm && widget.noHScroll) cm.display.alignWidgets = true; |
| 6692 | changeLine(doc, handle, "widget", function(line) { |
| 6693 | var widgets = line.widgets || (line.widgets = []); |
| 6694 | if (widget.insertAt == null) widgets.push(widget); |
| 6695 | else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); |
| 6696 | widget.line = line; |
| 6697 | if (cm && !lineIsHidden(doc, line)) { |
| 6698 | var aboveVisible = heightAtLine(line) < doc.scrollTop; |
| 6699 | updateLineHeight(line, line.height + widgetHeight(widget)); |
| 6700 | if (aboveVisible) addToScrollPos(cm, null, widget.height); |
| 6701 | cm.curOp.forceUpdate = true; |
| 6702 | } |
| 6703 | return true; |
| 6704 | }); |
| 6705 | return widget; |
| 6706 | } |
| 6707 | |
| 6708 | // LINE DATA STRUCTURE |
| 6709 |
no test coverage detected