Call ReApplySearch after layout

This fixes a possible crash when exiting filter mode in the commits panel.
This commit is contained in:
Stefan Haller 2024-08-18 21:11:21 +02:00
parent 926061557b
commit 15d17e16dd

View file

@ -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
} }