mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-17 00:18:05 +02:00
Rename FuzzySearchFunc to FilterFunc
It isn't necessarily fuzzy any more.
This commit is contained in:
@ -38,7 +38,7 @@ func (self *CustomCommandAction) Call() error {
|
|||||||
func (self *CustomCommandAction) GetCustomCommandsHistorySuggestionsFunc() func(string) []*types.Suggestion {
|
func (self *CustomCommandAction) GetCustomCommandsHistorySuggestionsFunc() func(string) []*types.Suggestion {
|
||||||
history := self.c.GetAppState().CustomCommandsHistory
|
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`
|
// this mimics the shell functionality `ignorespace`
|
||||||
|
@ -66,7 +66,7 @@ func matchesToSuggestions(matches []string) []*types.Suggestion {
|
|||||||
func (self *SuggestionsHelper) GetRemoteSuggestionsFunc() func(string) []*types.Suggestion {
|
func (self *SuggestionsHelper) GetRemoteSuggestionsFunc() func(string) []*types.Suggestion {
|
||||||
remoteNames := self.getRemoteNames()
|
remoteNames := self.getRemoteNames()
|
||||||
|
|
||||||
return FuzzySearchFunc(remoteNames, self.c.UserConfig.Gui.UseFuzzySearch())
|
return FilterFunc(remoteNames, self.c.UserConfig.Gui.UseFuzzySearch())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *SuggestionsHelper) getBranchNames() []string {
|
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 {
|
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 {
|
func (self *SuggestionsHelper) getTagNames() []string {
|
||||||
@ -175,7 +175,7 @@ func (self *SuggestionsHelper) getTagNames() []string {
|
|||||||
func (self *SuggestionsHelper) GetTagsSuggestionsFunc() func(string) []*types.Suggestion {
|
func (self *SuggestionsHelper) GetTagsSuggestionsFunc() func(string) []*types.Suggestion {
|
||||||
tagNames := self.getTagNames()
|
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 {
|
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...)
|
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 {
|
func (self *SuggestionsHelper) GetAuthorsSuggestionsFunc() func(string) []*types.Suggestion {
|
||||||
@ -196,10 +196,10 @@ func (self *SuggestionsHelper) GetAuthorsSuggestionsFunc() func(string) []*types
|
|||||||
|
|
||||||
slices.Sort(authors)
|
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 {
|
return func(input string) []*types.Suggestion {
|
||||||
var matches []string
|
var matches []string
|
||||||
if input == "" {
|
if input == "" {
|
||||||
|
Reference in New Issue
Block a user