Pre-flight checks
Problem
Markra does not currently support creating multiple carets with Ctrl+Click on Windows or with another mouse gesture.
Making the same small edit at several non-contiguous locations therefore requires repeating the edit manually or using find and replace, which may affect unintended matches. Common examples include adding the same prefix or suffix to several lines, updating selected Markdown fragments, or editing multiple list items at once.
Proposed solution
Enable multiple selections in the production editors and support multi-cursor editing in both WYSIWYG and Source modes:
- Hold
Alt on Windows/Linux or Option on macOS and left-click an ordinary editable text position to add another caret without removing existing carets.
Alt/Option-click an existing caret to remove it.
- Typing and standard editing actions—at minimum text input,
Backspace, Delete, and Enter—should apply at every caret.
- Treat a simultaneous multi-caret edit as one undo/redo operation.
- A normal click should return to a single caret.
- Pressing
Escape should remove secondary carets while keeping the primary caret.
- All active carets and non-contiguous selections should remain clearly visible.
Existing interactions must continue to work:
Ctrl/Cmd+Click must continue to open links.
- The multi-cursor gesture must not reuse CodeMirror's default
Ctrl/Cmd+Click behavior.
- Single-selection commands such as the slash menu or AI selection actions should either operate only on the primary selection or be unavailable while multiple carets are active.
- Read-only, IME, Vim mode, and typewriter mode behavior should not regress.
Acceptance criteria
- Multiple carets can be created and removed with
Alt/Option+Click.
- A single edit is applied correctly at every caret.
- The feature works at ordinary editable text positions in both WYSIWYG and Source modes.
- Undo and redo treat each simultaneous edit as one operation.
- Switching back to a single caret is predictable.
Ctrl/Cmd+Click link navigation remains functional.
- Focused tests cover caret creation, simultaneous insertion/deletion, undo/redo, and relevant mouse-event conflicts.
Initial scope
The first implementation may exclude interactive rendered widgets that maintain their own pointer or editing behavior, including visual table cells, images, media controls, and table controls.
The following can be handled separately:
- Column or rectangular selection
- Add-caret-above/below shortcuts
- Select next/all occurrences
- Configurable multi-cursor modifiers
- Multi-cursor editing across visual table cells
Product area
Editing
Alternatives considered
- Repeating each edit manually
- Using find and replace
Find and replace is useful when every occurrence should change, but it is less suitable when only several specific locations need editing.
Additional context
Markra does not currently enable multiple selections in its production editors. Both WYSIWYG and Source modes use CodeMirror's minimalSetup, while EditorState.allowMultipleSelections currently appears only in tests.
The implementation should explicitly:
- Enable
EditorState.allowMultipleSelections.
- Configure
Alt/Option+Click as the gesture that adds a selection range.
- Avoid CodeMirror's default
Ctrl/Cmd+Click modifier because Markra already uses it to open links.
- Audit rendered Markdown widgets that intercept mouse events and currently replace the selection with a single caret.
- Define whether external document refreshes preserve mapped secondary carets or intentionally collapse them.
Reference behavior:
Pre-flight checks
Problem
Markra does not currently support creating multiple carets with
Ctrl+Clickon Windows or with another mouse gesture.Making the same small edit at several non-contiguous locations therefore requires repeating the edit manually or using find and replace, which may affect unintended matches. Common examples include adding the same prefix or suffix to several lines, updating selected Markdown fragments, or editing multiple list items at once.
Proposed solution
Enable multiple selections in the production editors and support multi-cursor editing in both WYSIWYG and Source modes:
Alton Windows/Linux orOptionon macOS and left-click an ordinary editable text position to add another caret without removing existing carets.Alt/Option-click an existing caret to remove it.Backspace,Delete, andEnter—should apply at every caret.Escapeshould remove secondary carets while keeping the primary caret.Existing interactions must continue to work:
Ctrl/Cmd+Clickmust continue to open links.Ctrl/Cmd+Clickbehavior.Acceptance criteria
Alt/Option+Click.Ctrl/Cmd+Clicklink navigation remains functional.Initial scope
The first implementation may exclude interactive rendered widgets that maintain their own pointer or editing behavior, including visual table cells, images, media controls, and table controls.
The following can be handled separately:
Product area
Editing
Alternatives considered
Find and replace is useful when every occurrence should change, but it is less suitable when only several specific locations need editing.
Additional context
Markra does not currently enable multiple selections in its production editors. Both WYSIWYG and Source modes use CodeMirror's
minimalSetup, whileEditorState.allowMultipleSelectionscurrently appears only in tests.The implementation should explicitly:
EditorState.allowMultipleSelections.Alt/Option+Clickas the gesture that adds a selection range.Ctrl/Cmd+Clickmodifier because Markra already uses it to open links.Reference behavior: