diff --git a/pkg/gui/controllers/helpers/search_helper.go b/pkg/gui/controllers/helpers/search_helper.go index b0b948292..5de08df6d 100644 --- a/pkg/gui/controllers/helpers/search_helper.go +++ b/pkg/gui/controllers/helpers/search_helper.go @@ -225,9 +225,7 @@ func (self *SearchHelper) OnPromptContentChanged(searchString string) { state := self.searchState() switch context := state.Context.(type) { case types.IFilterableContext: - context.SetSelection(0) - context.SetFilter(searchString, self.c.UserConfig().Gui.UseFuzzySearch()) - self.c.PostRefreshUpdate(context) + self.ApplyFilter(context, searchString) case types.ISearchableContext: // do nothing default: @@ -235,6 +233,12 @@ func (self *SearchHelper) OnPromptContentChanged(searchString string) { } } +func (self *SearchHelper) ApplyFilter(context types.IFilterableContext, filter string) { + context.SetSelection(0) + context.SetFilter(filter, self.c.UserConfig().Gui.UseFuzzySearch()) + self.c.PostRefreshUpdate(context) +} + func (self *SearchHelper) ReApplyFilter(context types.Context) { filterableContext, ok := context.(types.IFilterableContext) if ok {