mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-12 08:36:25 -04:00
The reveal that advances the focused main view's selection after staging captured the next/previous change block as a patch identity and found it again in the re-rendered diff via SamePatchLine. SamePatchLine keys a deletion on its old-file (index-side) line number, which staging shifts: staging a hunk that changes the line count moves the index-side numbers of every hunk below it. So a deletion-led "next hunk" candidate no longer matched, and the reveal fell back to a worse candidate — often colliding with a header or context row (SamePatchLine doesn't require a change line) and, in hunk mode, snapping to the first change block. The visible result was the selection jumping to an *earlier* hunk after staging. Match the reveal's candidates by their worktree (new-file) line number, which staging never moves, and require a change line of the same side. This is safe here because the reveal only ever targets change blocks and selectHunkAround expands to the whole block, so the new-file number's ambiguity between two consecutive deletions (the reason SamePatchLine uses the old-file number) doesn't matter. The escape restore and the -U context-size preserve keep SamePatchLine: they re-render the same staged/unstaged state, so no index-side shift, and the latter deliberately anchors on context lines. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| amend_helper.go | ||
| app_status_helper.go | ||
| bisect_helper.go | ||
| branches_helper.go | ||
| cherry_pick_helper.go | ||
| commit_files_helper.go | ||
| commits_helper.go | ||
| commits_helper_test.go | ||
| confirmation_helper.go | ||
| credentials_helper.go | ||
| diff_helper.go | ||
| diff_line_navigation.go | ||
| diff_line_navigation_test.go | ||
| diff_line_parser.go | ||
| diff_line_parser_test.go | ||
| drag_autoscroller.go | ||
| drag_autoscroller_test.go | ||
| files_helper.go | ||
| fixup_helper.go | ||
| fixup_helper_test.go | ||
| gpg_helper.go | ||
| helpers.go | ||
| host_helper.go | ||
| inline_status_helper.go | ||
| menu_key.go | ||
| merge_and_rebase_helper.go | ||
| merge_conflicts_helper.go | ||
| mode_helper.go | ||
| patch_building_helper.go | ||
| record_directory_helper.go | ||
| refresh_helper.go | ||
| refresh_helper_test.go | ||
| refs_helper.go | ||
| repos_helper.go | ||
| search_helper.go | ||
| signal_handling.go | ||
| signal_handling_windows.go | ||
| snake_helper.go | ||
| staging_helper.go | ||
| sub_commits_helper.go | ||
| suggestions_helper.go | ||
| suspend_resume_helper.go | ||
| tags_helper.go | ||
| update_helper.go | ||
| upstream_helper.go | ||
| upstream_helper_test.go | ||
| view_helper.go | ||
| window_arrangement_helper.go | ||
| window_arrangement_helper_test.go | ||
| window_helper.go | ||
| working_tree_helper.go | ||
| worktree_helper.go | ||
| worktree_helper_test.go | ||