Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ export const KeyboardShortcutsExtension = Extension.create<{
return false;
}

const selectionAtBlockStart =
state.selection.from ===
blockInfo.blockContent.beforePos + 1;
if (!selectionAtBlockStart) {
return false;
}

const prevBlockInfo = getPrevBlockInfo(
state.doc,
blockInfo.bnBlock.beforePos,
Expand Down Expand Up @@ -454,15 +461,22 @@ export const KeyboardShortcutsExtension = Extension.create<{

return false;
}),
// If the previous block is a columnList, moves the current block to
// the end of the last column in it.
// If the next block is a columnList, moves the first block from its
// first column to after the current block.
() =>
commands.command(({ state, tr, dispatch }) => {
const blockInfo = getBlockInfoFromSelection(state);
if (!blockInfo.isBlockContainer) {
return false;
}

const selectionAtBlockEnd =
state.selection.from ===
blockInfo.blockContent.afterPos - 1;
if (!selectionAtBlockEnd) {
return false;
}

const nextBlockInfo = getNextBlockInfo(
state.doc,
blockInfo.bnBlock.beforePos,
Expand Down
Loading
Loading