1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

When refreshing models, re-apply active filter for the corresponding view

This commit is contained in:
Stefan Haller
2023-10-08 19:52:54 +02:00
parent ecaa4846f1
commit b5ca6a3add
7 changed files with 96 additions and 16 deletions

View File

@ -227,6 +227,18 @@ func (self *SearchHelper) OnPromptContentChanged(searchString string) {
}
}
func (self *SearchHelper) ReApplyFilter(context types.Context) {
state := self.searchState()
if context == state.Context {
filterableContext, ok := context.(types.IFilterableContext)
if ok {
filterableContext.SetSelectedLineIdx(0)
_ = filterableContext.GetView().SetOriginY(0)
filterableContext.ReApplyFilter()
}
}
}
func (self *SearchHelper) RenderSearchStatus(c types.Context) {
if c.GetKey() == context.SEARCH_CONTEXT_KEY {
return