(cm, handle, node, options)
| 5512 | } |
| 5513 | |
| 5514 | function addLineWidget(cm, handle, node, options) { |
| 5515 | var widget = new LineWidget(cm, node, options); |
| 5516 | if (widget.noHScroll) cm.display.alignWidgets = true; |
| 5517 | changeLine(cm, handle, "widget", function(line) { |
| 5518 | var widgets = line.widgets || (line.widgets = []); |
| 5519 | if (widget.insertAt == null) widgets.push(widget); |
| 5520 | else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); |
| 5521 | widget.line = line; |
| 5522 | if (!lineIsHidden(cm.doc, line)) { |
| 5523 | var aboveVisible = heightAtLine(line) < cm.doc.scrollTop; |
| 5524 | updateLineHeight(line, line.height + widgetHeight(widget)); |
| 5525 | if (aboveVisible) addToScrollPos(cm, null, widget.height); |
| 5526 | cm.curOp.forceUpdate = true; |
| 5527 | } |
| 5528 | return true; |
| 5529 | }); |
| 5530 | return widget; |
| 5531 | } |
| 5532 | |
| 5533 | // LINE DATA STRUCTURE |
| 5534 |
no test coverage detected
searching dependent graphs…