Update search result index when changing selection#95
Merged
stefanhaller merged 6 commits intomasterfrom Jan 4, 2026
Merged
Conversation
…selection For views that don't show the highlighted line it doesn't make sense to start searching from the cursor position, so select the first match in that case.
One for setting the selection, and one for rendering the "match x of y" string; we want to use them separately in the next commit.
Can be used after changing the selection in a view, to make the search result follow.
This improves the case where the user has moved the selection to before the first match and presses 'n', or to after the current match and presses 'N'. In both cases we now simply jump to the current match again.
stefanhaller
added a commit
to jesseduffield/lazygit
that referenced
this pull request
Jan 4, 2026
…a list view (#5169) When searching (not filtering) in a list view using `/`, moving the selection now updates the "x of y" indicator of the search results to the last one before the selection. Pressing `n` again searches from there rather than from the previously shown result. Also see corresponding gocui PR at jesseduffield/gocui#95.
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.
See jesseduffield/lazygit#5169.