diff --git a/pkg/gui/controllers/patch_building_from_main_view.go b/pkg/gui/controllers/patch_building_from_main_view.go index d66dbdb5a..4fba9054f 100644 --- a/pkg/gui/controllers/patch_building_from_main_view.go +++ b/pkg/gui/controllers/patch_building_from_main_view.go @@ -213,12 +213,9 @@ func discardSelectionFromCommit( }, func(gocui.Task) error { c.LogAction(c.Tr.Actions.RemovePatchFromCommit) err := c.Git().Patch.DeletePatchesFromCommit(c.Model().Commits, commitIndex) - // The rebase removes the selected lines, so the commit's diff shrinks - // there. Re-establish the selection at its change-line ordinal once the - // refresh below re-renders the diff, advancing to the next surviving change - // just like staging — installed before the refresh so the re-render rides - // it. The diff stays in the same pane, so source and target are the same. - revealSelectionAfterPrimaryAction(c, mainViewName, mainViewName, firstLineIdx) + // The rebase rewrites the commit, so the focused main view's selection is + // re-established on the next surviving change as the diff re-renders (see + // preserveFocusedMainViewSelectionAcrossContentChange). return c.Helpers().MergeAndRebase.CheckMergeOrRebase(err) }) },