Desktop: Improve macOS word navigation with Option+Arrow#15165
Desktop: Improve macOS word navigation with Option+Arrow#15165MANVENDRA-github wants to merge 4 commits intolaurent22:devfrom
Conversation
| { key: 'Alt-ArrowRight', run: cursorGroupRight }, | ||
| { key: 'Alt-ArrowLeft', run: cursorGroupLeft }, |
There was a problem hiding this comment.
Note: Based on the documentation, it looks like this should be part of the standard CodeMirror keymap extension.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/editor/CodeMirror/configFromSettings.ts`:
- Line 32: The change introduced an unnecessary blank line before the function
configFromSettings; revert that whitespace-only edit so the function
declaration's surrounding spacing matches the original style. Locate the
configFromSettings function in packages/editor/CodeMirror/configFromSettings.ts
and remove the extra newline so there are no added blank lines or
formatting-only changes.
- Line 13: Remove the duplicate registration of standardKeymap: delete the
import of standardKeymap from '@codemirror/commands' in configFromSettings.ts
and remove any code that adds standardKeymap to the keymap there (leave
defaultKeymap and emacsStyleKeymap as needed); createEditor.ts already registers
...standardKeymap in keymapConfig (Prec.low), so eliminating the import and
registration here prevents duplicate bindings and preserves intended precedence.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5f6a47b2-3f88-4aa2-b17b-86444037afcd
📒 Files selected for processing (1)
packages/editor/CodeMirror/configFromSettings.ts
The linked issue seems to be about command+arrow (configured via a |
|
yeah option+arrow also seems to be broken lemme do a check and get back to you on this |
|
I tested this on macOS (Tahoe 26.3.1) to verify the reported behavior of cmd + arrow and also the behavior of option + arrow. In joplin: Given this, it appears that: option + arrow is functioning correctly So this doesnt seem to be an issue specific to joplin its more of a feature request Based on this, I’ve removed the previously added keymap changes (including the redundant standardKeymap registration) to align with CodeMirror’s default behavior and avoid introducing conflicts. let me know if you’d like me to take a different approach here or if this should be treated as a separate feature discussion. I have also asked the user for their macos version coz it seems to me that the DefaultKeyBinding.dict doesnt work properly in newer ones |
Fixes #15149
Problem:
Joplin uses CodeMirror for editing, which does not automatically respect macOS system keybindings. As a result, standard macOS shortcuts like Option + Arrow may not behave consistently for word navigation.
Solution:
Adds a macOS-specific keymap override that maps:
2 Option + Left - move to previous word