How to mark decoration.replace as error

Hi there,

I’ve noticed something strange between Decoration.replace and Linter.

When I set a lint error that matches the widget’s range exactly, the widget will not be wrapped by cm-lintRange-error

And when I adjust the error range to contain the widget, it is wrapped correctly. So I can see the underline of this error.

How could I mark this single widget as an error ?

Thank you~

And here is the demo

This falls out of the way decorations work. A non-inclusive mark decoration that is entirely covered by a replace decorations will be considered inside it, and not style the replacement widget.

This patch makes lint decorations inclusive, to avoid the issue in this specific situation.

1 Like

Ok, I got it.

I’ve testd out your patch version, and when those decorations are both inclusive, it works fine.


I have reverted this patch again, since it caused issues. It doesn’t seem entirely unreasonable, when you replace the marked text, for the mark to become invisible.