Problem
In src/plugins/multiCursor/inputHandling.ts (lines 194–226), the ArrowUp/ArrowDown handler for multi-cursor mode uses Selection.findFrom($head, dir, true) to find the target position. This is a document-order operation that searches for the nearest valid text selection position, not a visual/coordinate-based vertical movement.
For single-line paragraphs, this works fine (it jumps to the adjacent block). But for long paragraphs with soft line wrapping, ArrowDown will not move to the line below visually — it will either find nothing or jump to the next textblock boundary.
In contrast, the addCursorAbove/addCursorBelow commands in commands.ts correctly use view.coordsAtPos/view.posAtCoords for coordinate-based vertical placement. The difference is that handleMultiCursorArrow only receives state (not view), so it cannot use coordinate-based movement.
Impact
ArrowUp/ArrowDown in multi-cursor mode behaves incorrectly in wrapped text — cursors jump between textblocks rather than moving visually up/down within a wrapped paragraph. This is inconsistent with normal ProseMirror vertical arrow behavior, which delegates to the browser's native caret movement.
Suggested fix
Either:
- Pass
EditorView through to handleMultiCursorArrow so it can use coordinate-based movement (like addCursorVertical does), or
- Handle vertical arrow keys at the view level (in
handleKeyDown plugin) where the view is available, rather than routing through the state-only handleMultiCursorArrow
File: src/plugins/multiCursor/inputHandling.ts:194-226
Problem
In
src/plugins/multiCursor/inputHandling.ts(lines 194–226), the ArrowUp/ArrowDown handler for multi-cursor mode usesSelection.findFrom($head, dir, true)to find the target position. This is a document-order operation that searches for the nearest valid text selection position, not a visual/coordinate-based vertical movement.For single-line paragraphs, this works fine (it jumps to the adjacent block). But for long paragraphs with soft line wrapping, ArrowDown will not move to the line below visually — it will either find nothing or jump to the next textblock boundary.
In contrast, the
addCursorAbove/addCursorBelowcommands incommands.tscorrectly useview.coordsAtPos/view.posAtCoordsfor coordinate-based vertical placement. The difference is thathandleMultiCursorArrowonly receivesstate(notview), so it cannot use coordinate-based movement.Impact
ArrowUp/ArrowDown in multi-cursor mode behaves incorrectly in wrapped text — cursors jump between textblocks rather than moving visually up/down within a wrapped paragraph. This is inconsistent with normal ProseMirror vertical arrow behavior, which delegates to the browser's native caret movement.
Suggested fix
Either:
EditorViewthrough tohandleMultiCursorArrowso it can use coordinate-based movement (likeaddCursorVerticaldoes), orhandleKeyDownplugin) where the view is available, rather than routing through the state-onlyhandleMultiCursorArrowFile:
src/plugins/multiCursor/inputHandling.ts:194-226