"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/model/line_widget.js" between
CodeMirror-5.58.2.tar.gz and CodeMirror-5.58.3.tar.gz

About: CodeMirror is a text editor implemented in JavaScript for the browser and specialized for editing code.

line_widget.js  (CodeMirror-5.58.2):line_widget.js  (CodeMirror-5.58.3)
skipping to change at line 66 skipping to change at line 66
addToScrollTop(cm, diff) addToScrollTop(cm, diff)
} }
export function addLineWidget(doc, handle, node, options) { export function addLineWidget(doc, handle, node, options) {
let widget = new LineWidget(doc, node, options) let widget = new LineWidget(doc, node, options)
let cm = doc.cm let cm = doc.cm
if (cm && widget.noHScroll) cm.display.alignWidgets = true if (cm && widget.noHScroll) cm.display.alignWidgets = true
changeLine(doc, handle, "widget", line => { changeLine(doc, handle, "widget", line => {
let widgets = line.widgets || (line.widgets = []) let widgets = line.widgets || (line.widgets = [])
if (widget.insertAt == null) widgets.push(widget) if (widget.insertAt == null) widgets.push(widget)
else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt )), 0, widget) else widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget)
widget.line = line widget.line = line
if (cm && !lineIsHidden(doc, line)) { if (cm && !lineIsHidden(doc, line)) {
let aboveVisible = heightAtLine(line) < doc.scrollTop let aboveVisible = heightAtLine(line) < doc.scrollTop
updateLineHeight(line, line.height + widgetHeight(widget)) updateLineHeight(line, line.height + widgetHeight(widget))
if (aboveVisible) addToScrollTop(cm, widget.height) if (aboveVisible) addToScrollTop(cm, widget.height)
cm.curOp.forceUpdate = true cm.curOp.forceUpdate = true
} }
return true return true
}) })
if (cm) signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "numbe r" ? handle : lineNo(handle)) if (cm) signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "numbe r" ? handle : lineNo(handle))
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)