1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-17 01:42:45 +02:00

Fix stale main view content when entering/exiting filtering view

When entering filtering we would only call FocusLine, which takes care of
highlighting the selected line in the commits list, but not of re-rendering the
main view. HandleFocus does that.

When exiting filtering, the HandleFocus call was missing entirely.

The tests needed to be reworked a little bit to make this testable.
This commit is contained in:
Stefan Haller
2025-07-09 15:12:03 +02:00
parent 457cdce61d
commit 4981419ba9
5 changed files with 47 additions and 23 deletions

View File

@ -178,6 +178,7 @@ func (self *ModeHelper) ClearFiltering() error {
// before we entered filtering
self.c.Contexts().LocalCommits.SelectCommitByHash(self.c.Modes().Filtering.GetSelectedCommitHash())
}
self.c.Contexts().LocalCommits.HandleFocus(types.OnFocusOpts{})
},
})
return nil