Repository navigation
feat(review): go to definition (d), back and forward (ctrl+o, ctrl+i) - #178
Merged
Merged
Conversation
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 20, 2026
backnotprop
force-pushed
the
feat/jump-to-definition
branch
from
November 20, 2026 04:34
1c5a594 to
7ff3c31
Compare
d on a line of the diff or the whole-file view searches for the identifier on it with the codenav core, on a thread of its own, on the side the cursor is on: the new side searches the reviewed version, the old side and the base view the base. Several identifiers on the line are offered in a small list. One clear answer is jumped to, in the diff when it shows that line, otherwise in the whole-file view on the searched side; several are listed with path:line, kind and the line text in the core's order. Nothing found says so in the footer, and "searching for ..." shows while the search runs. ctrl+o goes back to the place jumped from and ctrl+i forward again, over a history of 30 places. The key help scrolls with j/k when it does not fit, and splits into two columns when the terminal is wide enough.
…t template literals
The identifier scan skipped a template literal whole. It now skips only the
literal's text and reads the code in each substitution, with nested braces,
strings and templates; an escaped \${ stays text.
backnotprop
force-pushed
the
feat/jump-to-definition
branch
from
November 20, 2026 04:39
7ff3c31 to
fa17837
Compare
Merged
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.
Adds go to definition to the code review screen, on top of the search core from #169 (
codenav).don a line of the diff or of the whole-file view takes the identifiers on that line (identifiers_on_line). With one, it searches at once. With several, a small list shows them left to right;1-9orEnterpicks one,Esccloses.codenav::search, 5 s), so the screen never waits. The footer sayssearching for <word>…while it runs.Found::best). It lands in the diff when the diff shows that line, otherwise in the whole-file view of that file at that line (the current file, or the base view when the base was searched).path:line,definition/useand the line text, in the core's ranking order.Entergoes there,Esccloses.no definition or use of <word> found(plus "in the base", and "the search stopped early" when the core stopped early).ctrl+ogoes back to where you jumped from, andctrl+igoes forward again. The history keeps 30 places (file, diff or whole-file view and its side, line).ctrl+ineeds a terminal that tells it apart from Tab; where it arrives as Tab, Tab keeps cycling the focus as before.Keys:
go-to-definition=d,jump-back=ctrl+o,jump-forward=ctrl+i, in the diff (and so in the whole-file view). All three are in the "late" list, so an older config that already uses those keys keeps them.dis still the block mark in document reviews. README (key table, code review keys, a paragraph under Code review) and the help screen are updated.The help screen had grown taller than a 34-row terminal and was being cut off. It now scrolls with
j/k(the bottom border says so) when it does not fit, and splits into two columns when the terminal is wide enough.Tests:
review/tests/jump_flow.rscovers one answer in the diff with ctrl+o and ctrl+i; the word list and a definition outside the diff opening the whole file; the answer list with Enter and Esc; nothing found; a base search landing in the base view; and the help.pull_flow.rssearches both sides of a PR from the cache repository. There are also unit tests for the history and the keymap.Also fixes the core's identifier scan (
codenav.rs, separate commit). It used to skip a JavaScript/TypeScript template literal whole, soreturn `${name} ${formatPrice(cents)}`;offered nothing. It now skips only the literal's text and reads the code inside each${…}, handling nested braces, strings and templates; an escaped\${stays text. Tests are incodenav/tests.rs.Rebased onto #177. The lists and the whole-file view use the full width when the notes rail is closed, which
jump_flow.rstests.