clearOnEnter with 1-character range

I’m using clearOnEnter to allow user to clear an error indicator when they’ve read it. The problem is that when the markText() range is only one character, there is no way to “enter” the range, and so they can’t clear it.

I’m not reporting this as a bug, since it does what it says on the tin, but I thought I’d mention it here.

I can probably work around the issue by checking if the cursor arrives on either side of the marked range using getCursor().

Thanks as always for a wonderful project!


You should be able to set inclusiveRight and inclusiveLeft to true when creating the marker to make cursor positions on its sides also count as inside, which I believe will solve this problem.

Yes of course! That worked. Thanks Marijn! :slight_smile: