add Cmd/Option+Up/Down shortcuts in source editor on macOS#15371
Conversation
Review Summary by QodoAdd macOS vertical cursor navigation shortcuts to source editor
WalkthroughsDescription• Add vertical cursor navigation shortcuts for macOS source editor - Command+Up/Down move to document start/end - Option+Up/Down move to paragraph start/end • Support Shift variants for selection extension • Refactor horizontal shortcut handling for better code organization • Add comprehensive unit tests for new vertical navigation shortcuts Diagramflowchart LR
A["macOS Key Events<br/>Up/Down Keys"] -->|"Command+Up/Down"| B["Document<br/>Start/End"]
A -->|"Option+Up/Down"| C["Paragraph<br/>Start/End"]
A -->|"Shift Variants"| D["Selection<br/>Extension"]
B --> E["CodeArea Navigation"]
C --> E
D --> E
File Changes1. jabgui/src/main/java/org/jabref/gui/keyboard/CodeAreaKeyBindings.java
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 📐 Spec deviations (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewⓘ The new review experience is currently in Beta. Learn more |
There was a problem hiding this comment.
Pull request overview
Adds macOS-standard vertical cursor navigation shortcuts to the BibTeX source editor’s CodeArea handling, completing the macOS cursor movement behavior started in #15358.
Changes:
- Extend macOS cursor shortcut handler to support
Command+Up/Down(document start/end) andOption+Up/Down(paragraph start/end), including shift-selection via the existing selection policy. - Add JUnit tests covering the new vertical shortcuts (and shift-selection for the
Commandvariants). - Document the fix in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
jabgui/src/main/java/org/jabref/gui/keyboard/CodeAreaKeyBindings.java |
Implements macOS vertical navigation handling for Command/Option + Up/Down in the source editor. |
jabgui/src/test/java/org/jabref/gui/keyboard/CodeAreaKeyBindingsTest.java |
Adds tests validating the new vertical shortcut behaviors. |
CHANGELOG.md |
Adds an Unreleased “Fixed” entry describing the macOS vertical shortcut fix. |
You can also share your feedback on Copilot code review. Take the survey.
| assertTrue(event.isConsumed()); | ||
| } | ||
|
|
||
| @Test |
c5460c9 to
5599ab4
Compare
|
Hey, we noticed that you force-pushed your changes. Force pushing is a bad practice when working together on a project (mainly because it is not supported well by GitHub itself). Commits are lost and comments on commits lose their context, thus making it harder to review changes. When the pull request is getting integrated into In future, please avoid that. For now, you can continue working. |
✅ All tests passed ✅🏷️ Commit: 5599ab4 Learn more about TestLens at testlens.app. |
Siedlerchr
left a comment
There was a problem hiding this comment.
Works as expected! Thanks for the follow up!
Related issues and pull requests
Closes #5937
Follow-up to #15358
PR Description
This PR extends macOS cursor navigation in the BibTeX source editor to cover vertical shortcuts.
Command+Up/Downnow moves the cursor to the document start/end, andOption+Up/Downmoves to the paragraph start/end. All shortcuts also supportShiftfor selection extension.Steps to test
.biblibrary and select an entryCommand+Up→ cursor should jump to the very beginning of the documentCommand+Down→ cursor should jump to the very end of the documentOption+Up→ cursor should jump to the start of the current paragraphOption+Down→ cursor should jump to the end of the current paragraphShiftwith any of the above to verify selection extension worksScreen.Recording.2026-03-19.at.2.35.23.PM.mov
Checklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)