From ebd04f32455db67e48e584d40cc6f736fdd4a745 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Fri, 14 Jun 2024 10:40:32 +0200 Subject: [PATCH] Make lint marks non-inclusive again Revert 88ba8ef965c57e707501b0486435ec15c4150ec6. FIX: Make lint markers non-inclusive again, since having them that way causes more issues than it solves. See https://discuss.codemirror.net/t/how-to-mark-decoration-replace-as-error/7590/2 Closes https://github.com/codemirror/dev/issues/1394 --- src/lint.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lint.ts b/src/lint.ts index e8eb1b1..26522f7 100644 --- a/src/lint.ts +++ b/src/lint.ts @@ -109,8 +109,7 @@ class LintState { }).range(d.from) : Decoration.mark({ attributes: {class: "cm-lintRange cm-lintRange-" + d.severity + (d.markClass ? " " + d.markClass : "")}, - diagnostic: d, - inclusive: true + diagnostic: d }).range(d.from, d.to) }), true) return new LintState(ranges, panel, findDiagnostic(ranges)) @@ -194,7 +193,7 @@ export function diagnosticCount(state: EditorState) { return lint ? lint.diagnostics.size : 0 } -const activeMark = Decoration.mark({class: "cm-lintRange cm-lintRange-active", inclusive: true}) +const activeMark = Decoration.mark({class: "cm-lintRange cm-lintRange-active"}) function lintTooltip(view: EditorView, pos: number, side: -1 | 1) { let {diagnostics} = view.state.field(lintState)