allow move cursor to replaced decoration

Hi. I’m trying to make a plugin to handle Setext headings in markdown.

In the example below, when the cursor is under the Setext heading (after line 2), moving the cursor up will jump directly to the Setext’s heading text. But I want it to jump to a mark, not the text of the heading (in this case, =====)

Example

I don’t know how to handle this case, please help.

Thanks.

I think you’ll have to add a binding for the up arrow key that, if the cursor is directly below such a heading, will explicitly put it inside the marker. (And otherwise, just return false to let the lower-precedence default binding handle it.)

I really appreciate you letting me know. I solved this problem with the ArrowUp keybinding. Thank you!