(cm, handle, node, options)
| 6482 | } |
| 6483 | |
| 6484 | function addLineWidget(cm, handle, node, options) { |
| 6485 | var widget = new LineWidget(cm, node, options); |
| 6486 | if (widget.noHScroll) cm.display.alignWidgets = true; |
| 6487 | changeLine(cm.doc, handle, "widget", function(line) { |
| 6488 | var widgets = line.widgets || (line.widgets = []); |
| 6489 | if (widget.insertAt == null) widgets.push(widget); |
| 6490 | else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); |
| 6491 | widget.line = line; |
| 6492 | if (!lineIsHidden(cm.doc, line)) { |
| 6493 | var aboveVisible = heightAtLine(line) < cm.doc.scrollTop; |
| 6494 | updateLineHeight(line, line.height + widgetHeight(widget)); |
| 6495 | if (aboveVisible) addToScrollPos(cm, null, widget.height); |
| 6496 | cm.curOp.forceUpdate = true; |
| 6497 | } |
| 6498 | return true; |
| 6499 | }); |
| 6500 | return widget; |
| 6501 | } |
| 6502 | |
| 6503 | // LINE DATA STRUCTURE |
| 6504 |
no test coverage detected