We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3630d3d commit e2f9d98Copy full SHA for e2f9d98
src/codemirror/extensions/highlightLineExtension.ts
@@ -47,9 +47,15 @@ export const lineHighlightField = StateField.define({
47
const highlights = value
48
.filter((line) => line <= lines) // one-indexed
49
.map((line) => lineHighlightMark.range(state.doc.line(line).from))
50
- return Decoration.none.update({
51
- add: highlights,
52
- })
+ highlights.sort((a, b) => a.from - b.from)
+ try {
+ return Decoration.none.update({
53
+ add: highlights,
54
+ })
55
+ } catch (e) {
56
+ console.error(e)
57
+ return Decoration.none
58
+ }
59
},
60
provide: (f) => EditorView.decorations.from(f),
61
})
0 commit comments