(cm, handle, node, options)
| 4359 | } |
| 4360 | |
| 4361 | function addLineWidget(cm, handle, node, options) { |
| 4362 | var widget = new LineWidget(cm, node, options); |
| 4363 | if (widget.noHScroll) cm.display.alignWidgets = true; |
| 4364 | changeLine(cm, handle, function(line) { |
| 4365 | var widgets = line.widgets || (line.widgets = []); |
| 4366 | if (widget.insertAt == null) widgets.push(widget); |
| 4367 | else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); |
| 4368 | widget.line = line; |
| 4369 | if (!lineIsHidden(cm.doc, line) || widget.showIfHidden) { |
| 4370 | var aboveVisible = heightAtLine(cm, line) < cm.doc.scrollTop; |
| 4371 | updateLineHeight(line, line.height + widgetHeight(widget)); |
| 4372 | if (aboveVisible) addToScrollPos(cm, 0, widget.height); |
| 4373 | cm.curOp.forceUpdate = true; |
| 4374 | } |
| 4375 | return true; |
| 4376 | }); |
| 4377 | return widget; |
| 4378 | } |
| 4379 | |
| 4380 | // LINE DATA STRUCTURE |
| 4381 |
no test coverage detected