summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2024-03-17 09:12:19 +0100
committerStefan Haller <stefan@haller-berlin.de>2024-03-17 11:56:29 +0100
commit7d2163d63297063364a18a4d62077badc1c1f47e (patch)
tree55d1d98e824f2d2e0bbc15ee1bbd73d1d86b9a49 /pkg
parent561afa990186ce6bdf7f62ce6e0114e6430eda8b (diff)
Rename FuzzySearchFunc to FilterFunc
It isn't necessarily fuzzy any more.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/controllers/custom_command_action.go2
-rw-r--r--pkg/gui/controllers/helpers/suggestions_helper.go12
2 files changed, 7 insertions, 7 deletions
diff --git a/pkg/gui/controllers/custom_command_action.go b/pkg/gui/controllers/custom_command_action.go
index 16d811aff..f4de3218e 100644
--- a/pkg/gui/controllers/custom_command_action.go
+++ b/pkg/gui/controllers/custom_command_action.go
@@ -38,7 +38,7 @@ func (self *CustomCommandAction) Call() error {
func (self *CustomCommandAction) GetCustomCommandsHistorySuggestionsFunc() func(string) []*types.Suggestion {
history := self.c.GetAppState().CustomCommandsHistory
- return helpers.FuzzySearchFunc(history, self.c.UserConfig.Gui.UseFuzzySearch())
+ return helpers.FilterFunc(history, self.c.UserConfig.Gui.UseFuzzySearch())
}
// this mimics the shell functionality `ignorespace`
diff --git a/pkg/gui/controllers/helpers/suggestions_helper.go b/pkg/gui/controllers/helpers/suggestions_helper.go
index b31a19f7a..ff8aeea71 100644
--- a/pkg/gui/controllers/helpers/suggestions_helper.go
+++ b/pkg/gui/controllers/helpers/suggestions_helper.go
@@ -66,7 +66,7 @@ func matchesToSuggestions(matches []string) []*types.Suggestion {
func (self *SuggestionsHelper) GetRemoteSuggestionsFunc() func(string) []*types.Suggestion {
remoteNames := self.getRemoteNames()
- return FuzzySearchFunc(remoteNames, self.c.UserConfig.Gui.UseFuzzySearch())
+ return FilterFunc(remoteNames, self.c.UserConfig.Gui.UseFuzzySearch())
}
func (self *SuggestionsHelper) getBranchNames() []string {
@@ -163,7 +163,7 @@ func (self *SuggestionsHelper) getRemoteBranchNames(separator string) []string {
}
func (self *SuggestionsHelper) GetRemoteBranchesSuggestionsFunc(separator string) func(string) []*types.Suggestion {
- return FuzzySearchFunc(self.getRemoteBranchNames(separator), self.c.UserConfig.Gui.UseFuzzySearch())
+ return FilterFunc(self.getRemoteBranchNames(separator), self.c.UserConfig.Gui.UseFuzzySearch())
}
func (self *SuggestionsHelper) getTagNames() []string {
@@ -175,7 +175,7 @@ func (self *SuggestionsHelper) getTagNames() []string {
func (self *SuggestionsHelper) GetTagsSuggestionsFunc() func(string) []*types.Suggestion {
tagNames := self.getTagNames()
- return FuzzySearchFunc(tagNames, self.c.UserConfig.Gui.UseFuzzySearch())
+ return FilterFunc(tagNames, self.c.UserConfig.Gui.UseFuzzySearch())
}
func (self *SuggestionsHelper) GetRefsSuggestionsFunc() func(string) []*types.Suggestion {
@@ -186,7 +186,7 @@ func (self *SuggestionsHelper) GetRefsSuggestionsFunc() func(string) []*types.Su
refNames := append(append(append(remoteBranchNames, localBranchNames...), tagNames...), additionalRefNames...)
- return FuzzySearchFunc(refNames, self.c.UserConfig.Gui.UseFuzzySearch())
+ return FilterFunc(refNames, self.c.UserConfig.Gui.UseFuzzySearch())
}
func (self *SuggestionsHelper) GetAuthorsSuggestionsFunc() func(string) []*types.Suggestion {
@@ -196,10 +196,10 @@ func (self *SuggestionsHelper) GetAuthorsSuggestionsFunc() func(string) []*types
slices.Sort(authors)
- return FuzzySearchFunc(authors, self.c.UserConfig.Gui.UseFuzzySearch())
+ return FilterFunc(authors, self.c.UserConfig.Gui.UseFuzzySearch())
}
-func FuzzySearchFunc(options []string, useFuzzySearch bool) func(string) []*types.Suggestion {
+func FilterFunc(options []string, useFuzzySearch bool) func(string) []*types.Suggestion {
return func(input string) []*types.Suggestion {
var matches []string
if input == "" {