Support spec.keepAdjacent in joinForwards and joinBackwards #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "keep-adjacent"
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?
I don't expect this to be ready to merge - just starting the conversation.
Some questions:
Any good ideas for spec property name? I've gone with
keepAdjacentbut I don't love it.Tests? I noticed there are no tests for the
isolatingspec property, so maybe you are OK without.Perhaps the deleteBarrier behaviour should only be suppressed if both the before and after nodes have
keepAdjacent. Right now, backspace only checks the before node, and delete the after node.I assume a corresponding PR for prosemirror-model will be needed. It looks like this will only be to include the new spec property in the doc comment. Do you follow any protocol for keeping such things in sync across repos?
I think the test will have to be a bit more specific, further down in the code—
deleteBarrierdoes a lot more than the joining that you want to turn off here, and most of that should not be turned off.Thanks for the advice. This is still giving the desired behaviour, and still keeps a lot of
deleteBarrieractive. I'll confess I'm fumbling in the dark a bit here. It's very difficult to think through the consequences of such changes in the face of arbitrary schemas!I did a force-push btw since if you do merge you won't want my experiments in your history. Not sure if that's the done thing or not...
BTW having looked more closely into this, I'm starting to think the best approach might be to make the node
isolatingand re-introduce the other behaviour I need with custom commands.All right, I'll let this sit until you know whether it'll be something you need then.
Pull request closed