1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2026-01-26 01:41:35 +03:00

Fix the main view display after reverting a commit (#5138)

After reverting a commit, the main view would show the diff of a commit
that is not the selected one.
This commit is contained in:
Stefan Haller
2025-12-23 14:59:28 +01:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@@ -869,7 +869,7 @@ func (self *LocalCommitsController) revert(commits []*models.Commit, start, end
return err
}
self.context().MoveSelection(len(commits))
self.context().FocusLine()
self.context().HandleFocus(types.OnFocusOpts{})
if mustStash {
if err := self.c.Git().Stash.Pop(0); err != nil {

View File

@@ -32,6 +32,9 @@ var Revert = NewIntegrationTest(NewIntegrationTestArgs{
Contains("Revert \"first commit\""),
Contains("first commit").IsSelected(),
).
Tap(func() {
t.Views().Main().Content(Contains("+myfile content"))
}).
SelectPreviousItem()
t.Views().Main().Content(Contains("-myfile content"))