1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-12-24 00:21:22 +02:00

Fix the main view display after reverting a commit

We move the selection down by the number of commits that were reverted (to keep
the same commits selected). However, this only happens after refreshing, which
has rendered the main view with the wrong commit, so we need to render it again
after moving the selection.

There are many other callers of MoveSelection in LocalCommitsController, but all
of them happen before the refresh. Revert is special because it needs to move
the selection after refreshing, e.g. when reverting the only commit of a branch.
This commit is contained in:
Stefan Haller
2025-12-23 14:45:42 +01:00
parent 0a48f307b1
commit a415d1b529
2 changed files with 1 additions and 4 deletions

View File

@@ -33,10 +33,7 @@ var Revert = NewIntegrationTest(NewIntegrationTestArgs{
Contains("first commit").IsSelected(),
).
Tap(func() {
/* EXPECTED:
t.Views().Main().Content(Contains("+myfile content"))
ACTUAL: */
t.Views().Main().Content(Contains("-myfile content"))
}).
SelectPreviousItem()