Avoid deleting block-level atoms with backspace #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "patch-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pressing backspace at the start of a block which is after a block marked as an "atom" will delete the preceding block. This is undesirable, so this change prevents atomic blocks from being deleted with backspace (they will be selected, instead).
I'm not 100% sure of the side-effects of this change, so please advise if there might be a better alternative solution.
This behavior was intentional. It may be undesirable to you, but just dropping it isn't something I'm interested in merging.
Would
before.isAtom && !before.type.spec.isolatingbe acceptable instead, so blocks marked asisolatingwould be protected from deletion in this way? (feel free to say no, as it's easy enough to add this behaviour elsewhere).I can work around this by creating an
ignoreAtomBlockNodeBackwardbackspace key handler, but it would be useful to know why the existing behaviour is intentional.I would suggest putting another command in front of
joinBackwardthat detects this situation and does whatever you want to happen there.That's what I've ended up doing, yes - posted here for reference:
Pull request closed