Skip to content

Commit 1b21a1c

Browse files
committed
Support spec.keepAdjacent in joinForwards and joinBackwards
1 parent ca85fa2 commit 1b21a1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/commands.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function joinBackward(state, dispatch, view) {
3636

3737
let before = $cut.nodeBefore
3838
// Apply the joining algorithm
39-
if (!before.type.spec.isolating && deleteBarrier(state, $cut, dispatch))
39+
if (!before.type.spec.isolating && !before.type.spec.keepAdjacent && deleteBarrier(state, $cut, dispatch))
4040
return true
4141

4242
// If the node below has no content and the node above is
@@ -118,7 +118,7 @@ export function joinForward(state, dispatch, view) {
118118

119119
let after = $cut.nodeAfter
120120
// Try the joining algorithm
121-
if (deleteBarrier(state, $cut, dispatch)) return true
121+
if (!after.type.spec.keepAdjacent && deleteBarrier(state, $cut, dispatch)) return true
122122

123123
// If the node above has no content and the node below is
124124
// selectable, delete the node above and select the one below.

0 commit comments

Comments
 (0)