indentation using spaces should remove single space on backspace


When using indentation using spaces, codemirror removes the complete bunch when pressing a backspace. For instance in the link shared - If I go 0 position of cursor and press tab, it will add 2 spaces. But when I hit backspace it removes the 2 spaces. It should treat space as single.

That’s not really your decision to make. The default deleteCharBackward command aligns to what many code editors do and deletes an entire unit of indentation. You can bind backspace to a custom command if you want to that behaves differently.

OK. Thank you for replying.

Hi @marijn,
I tried to create custom backspace based on the current deleteCharBackward implementation and found it complex. Specially when internal function deleteBy is not exported.
Is there a way to make the behaviour optional, or export deleteBy method to allow writing custom behaviour?

VS-Code allows it to be optional.

This patch adds a separate deleteCharBackwardStrict command.

That’s awesome!
Thank you so much. Can’t wait for the next CM release.

Tagged 6.4.0

That is superfast. Thank you so much!