feat: add Jump Back / Jump Forward to navigate the jump history - #388
Merged
Merged
Conversation
Every jump between a class under test and its test case (shortcut, editor/package explorer menus or code mining) now remembers the location it was made from. The new commands "Jump Back" (Ctrl+Alt+Shift+ARROW_LEFT) and "Jump Forward" (Ctrl+Alt+Shift+ARROW_RIGHT) navigate in this history the way a web browser does, restoring the exact cursor position. Both are also available in the editor MoreUnit menu, and their shortcut can be configured in Preferences > Keys. JumpCodeMining now delegates its jump to JumpActionExecutor instead of duplicating it, so that every jump is registered in the history. EditorPartFacade.getTextSelection() has become null-safe.
Unit tests for JumpNavigationHistory and JumpLocation, jump registration and back/forward scenarios in JumpActionExecutorTest (including cursor position restore and empty history), plus a SWTBot test exercising the whole flow with the real shortcuts.
RoiSoleil
force-pushed
the
feat/jump-back-forward
branch
2 times, most recently
from
September 24, 2026 13:32
abc27d9 to
daa425e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds Jump Back (
Ctrl+Alt+Shift+←) and Jump Forward (Ctrl+Alt+Shift+→): navigate back and forward between the locations visited when jumping between a class under test and its test case (and vice versa), the way a web browser does.Every jump (keyboard shortcut, editor / package explorer menus, code mining clicks) now remembers where the user jumped from:
Typical flow:
Ctrl+Shift+Jto the test method, write the test,Jump Backto continue coding the method under test at the exact place you left.How
org.moreunit.navigationpackage:JumpLocation(compilation unit + offset) andJumpNavigationHistory(back/forward stacks, browser semantics)JumpActionExecutorregisters every performed jump and executes the back/forward commands — for all jump entries:JumpCodeMiningnow delegates its jump to it instead of duplicating the code, so code mining jumps are followed tooEditorUI.revealOffset(...)restores the cursor position when navigatingEditorPartFacade.getTextSelection()is now null-safe (returnsnullinstead of throwing when the editor has no text selection)Testing
JumpNavigationHistoryTest(12) andJumpLocationTest(6)JumpActionExecutorTest: jump registration (from editor and from package explorer entry points), back/forward round trip with cursor position restore, no-op when the history is emptyJumpNavigationTest) exercising the whole flow with the real shortcuts (jump → back → forward, asserting the editor and the cursor line), plusShortcutStrategy.pressJumpBack/ForwardShortcut()core.test666,test922,mock.test433,mock.it22)BasicJumpTestfails there identically, with or without this branch), soJumpNavigationTestis expected to be exercised by the CI (windows-latest) only.Documentation
help/documentation.htmldocuments the new shortcuts next to the existing "Switching between test and class under test" section.