mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 23:56:24 -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> |
||
|---|---|---|
| .. | ||
| context | ||
| controllers | ||
| filetree | ||
| mergeconflicts | ||
| modes | ||
| patch_exploring | ||
| popup | ||
| presentation | ||
| services/custom_commands | ||
| status | ||
| style | ||
| types | ||
| background.go | ||
| command_log_panel.go | ||
| context.go | ||
| context_config.go | ||
| controllers.go | ||
| dummies.go | ||
| editors.go | ||
| extras_panel.go | ||
| global_handlers.go | ||
| gui.go | ||
| gui_common.go | ||
| gui_driver.go | ||
| information_panel.go | ||
| keybindings.go | ||
| layout.go | ||
| main_panels.go | ||
| menu_panel.go | ||
| options_map.go | ||
| pty.go | ||
| pty_test.go | ||
| recent_repos_panel.go | ||
| side_panels.go | ||
| side_panels_test.go | ||
| tasks_adapter.go | ||
| tasks_adapter_test.go | ||
| test_mode.go | ||
| test_timeout_norace.go | ||
| test_timeout_race.go | ||
| view_helpers.go | ||
| views.go | ||