Skip to content

Commit

Permalink
Make lint marks non-inclusive again
Browse files Browse the repository at this point in the history
Revert 88ba8ef.

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 codemirror/dev#1394
  • Loading branch information
marijnh committed Jun 14, 2024
1 parent 42076ce commit ebd04f3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ebd04f3

Please sign in to comment.