mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 20:36:03 +02:00
Call ReApplySearch after layout
This fixes a possible crash when exiting filter mode in the commits panel.
This commit is contained in:
parent
926061557b
commit
15d17e16dd
1 changed files with 13 additions and 3 deletions
|
@ -765,8 +765,18 @@ func (self *RefreshHelper) refreshView(context types.Context) error {
|
||||||
|
|
||||||
err := self.c.PostRefreshUpdate(context)
|
err := self.c.PostRefreshUpdate(context)
|
||||||
|
|
||||||
// Re-applying the search must be done after re-rendering the view though,
|
self.c.AfterLayout(func() error {
|
||||||
// so that the "x of y" status is shown correctly.
|
// Re-applying the search must be done after re-rendering the view though,
|
||||||
self.searchHelper.ReApplySearch(context)
|
// so that the "x of y" status is shown correctly.
|
||||||
|
//
|
||||||
|
// Also, it must be done after layout, because otherwise FocusPoint
|
||||||
|
// hasn't been called yet (see ListContextTrait.FocusLine), which means
|
||||||
|
// that the scroll position might be such that the entire visible
|
||||||
|
// content is outside the viewport. And this would cause problems in
|
||||||
|
// searchModelCommits.
|
||||||
|
self.searchHelper.ReApplySearch(context)
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue