Skip to content

Commit 57ba96e

Browse files
committed
Fix handling of insertAt option to addLineWidget
Issue #6460
1 parent f006f3d commit 57ba96e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/model/line_widget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function addLineWidget(doc, handle, node, options) {
6363
changeLine(doc, handle, "widget", line => {
6464
let widgets = line.widgets || (line.widgets = [])
6565
if (widget.insertAt == null) widgets.push(widget)
66-
else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget)
66+
else widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget)
6767
widget.line = line
6868
if (cm && !lineIsHidden(doc, line)) {
6969
let aboveVisible = heightAtLine(line) < doc.scrollTop

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy