(cm, handle, node, options)
| 3806 | } |
| 3807 | |
| 3808 | function addLineWidget(cm, handle, node, options) { |
| 3809 | var widget = new LineWidget(cm, node, options); |
| 3810 | if (widget.noHScroll) cm.display.alignWidgets = true; |
| 3811 | changeLine(cm, handle, function(line) { |
| 3812 | (line.widgets || (line.widgets = [])).push(widget); |
| 3813 | widget.line = line; |
| 3814 | if (!lineIsHidden(cm.doc, line) || widget.showIfHidden) { |
| 3815 | var aboveVisible = heightAtLine(cm, line) < cm.display.scroller.scrollTop; |
| 3816 | updateLineHeight(line, line.height + widgetHeight(widget)); |
| 3817 | if (aboveVisible) |
| 3818 | cm.curOp.updateScrollPos = {scrollTop: cm.doc.scrollTop + widget.height, |
| 3819 | scrollLeft: cm.doc.scrollLeft}; |
| 3820 | } |
| 3821 | return true; |
| 3822 | }); |
| 3823 | return widget; |
| 3824 | } |
| 3825 | |
| 3826 | // LINE DATA STRUCTURE |
| 3827 |
no test coverage detected