How to resolve keymap confict with atomic ranges?

Hi!

I’m working bullet lists with markdown, and I’m aiming for the deletion behavior below, where if there’s a multi-line bullet item, deletion of the first indent leads to deletion of all the leading whitespace as below. (There’s also a link to a runnable example at the end)

withoutKeymap

For what I’m trying to do, I am replacing the whitespace/indentations with widgets though for the demo above I only implemented the simplest mark decoration that’s also atomic. Deletion works as expected when markdown language keymaps are not included. However, I also still want to use the markdown keymaps, and if those are included, it looks like deletion behavior becomes based on the language indentation, and the atomic ranges become secondary:

withKeymap

I think this can be handled with a backspace keymap, but I would like to ask if this is intended, and I’m just missing something? And if so, what would be the suggested way to prioritize the atomic ranges?

Thanks!

Link to runnable demo

Indeed, the markdown package’s deleteMarkupBackward will base the range it deletes on the syntax tree, and not look at atomic ranges. You could, if you want to override it only in specific situations, bind another command with higher precedence to check for those situations and do its own thing when they apply.

Got it. Thank you very much!