mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
Drop the menu-specific wording for the filter prompt
The only menu that ever asked for it was the keybindings menu, which now filters as you type and doesn't use the prompt at all. That leaves every filterable context with the same prompt, so the whole hook can go, and with it the two implementations that only existed to satisfy it. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
fb761892aa
commit
bb7e74968b
|
|
@ -1,7 +1,5 @@
|
|||
package context
|
||||
|
||||
import "github.com/jesseduffield/lazygit/pkg/i18n"
|
||||
|
||||
type FilteredListViewModel[T HasID] struct {
|
||||
*FilteredList[T]
|
||||
*ListViewModel[T]
|
||||
|
|
@ -35,8 +33,3 @@ func (self *FilteredListViewModel[T]) ClearFilter() {
|
|||
|
||||
self.SetSelection(unfilteredIndex)
|
||||
}
|
||||
|
||||
// Default implementation of most filterable contexts. Can be overridden if needed.
|
||||
func (self *FilteredListViewModel[T]) FilterPrefix(tr *i18n.TranslationSet) string {
|
||||
return tr.FilterPrefix
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import (
|
|||
"github.com/jesseduffield/lazygit/pkg/gocui"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/style"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||
"github.com/jesseduffield/lazygit/pkg/i18n"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
|
@ -323,11 +322,3 @@ func (self *MenuContext) GetInputViewName() string {
|
|||
|
||||
return self.GetViewName()
|
||||
}
|
||||
|
||||
func (self *MenuContext) FilterPrefix(tr *i18n.TranslationSet) string {
|
||||
if self.allowFilteringKeybindings {
|
||||
return tr.FilterPrefixMenu
|
||||
}
|
||||
|
||||
return self.FilteredListViewModel.FilterPrefix(tr)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ func (self *SearchHelper) OpenFilterPrompt(context types.IFilterableContext) {
|
|||
|
||||
state.Context = context
|
||||
|
||||
self.searchPrefixView().SetContent(context.FilterPrefix(self.c.Tr))
|
||||
self.searchPrefixView().SetContent(self.c.Tr.FilterPrefix)
|
||||
promptView := self.promptView()
|
||||
promptView.ClearTextArea()
|
||||
self.OnPromptContentChanged("")
|
||||
|
|
@ -70,7 +70,7 @@ func (self *SearchHelper) DisplayFilterStatus(context types.IFilterableContext)
|
|||
state.Context = context
|
||||
searchString := context.GetFilter()
|
||||
|
||||
self.searchPrefixView().SetContent(context.FilterPrefix(self.c.Tr))
|
||||
self.searchPrefixView().SetContent(self.c.Tr.FilterPrefix)
|
||||
|
||||
promptView := self.promptView()
|
||||
keybindingConfig := self.c.UserConfig().Keybinding
|
||||
|
|
|
|||
|
|
@ -87,8 +87,8 @@ func (self *WindowArrangementHelper) GetWindowDimensions(informationStr string,
|
|||
repoState := self.c.State().GetRepoState()
|
||||
|
||||
var searchPrefix string
|
||||
if filterableContext, ok := repoState.GetSearchState().Context.(types.IFilterableContext); ok {
|
||||
searchPrefix = filterableContext.FilterPrefix(self.c.Tr)
|
||||
if _, ok := repoState.GetSearchState().Context.(types.IFilterableContext); ok {
|
||||
searchPrefix = self.c.Tr.FilterPrefix
|
||||
} else {
|
||||
searchPrefix = self.c.Tr.SearchPrefix
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import (
|
|||
"github.com/jesseduffield/lazygit/pkg/common"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/context/traits"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||
"github.com/jesseduffield/lazygit/pkg/i18n"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
|
@ -263,10 +262,6 @@ func (self *CommitFileTreeViewModel) IsFiltering() bool {
|
|||
// used for type switch
|
||||
func (self *CommitFileTreeViewModel) IsFilterableContext() {}
|
||||
|
||||
func (self *CommitFileTreeViewModel) FilterPrefix(tr *i18n.TranslationSet) string {
|
||||
return tr.FilterPrefix
|
||||
}
|
||||
|
||||
func (self *CommitFileTreeViewModel) GetSearchHistory() *utils.HistoryBuffer[string] {
|
||||
return self.searchHistory
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import (
|
|||
"github.com/jesseduffield/lazygit/pkg/common"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/context/traits"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||
"github.com/jesseduffield/lazygit/pkg/i18n"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
|
@ -274,10 +273,6 @@ func (self *FileTreeViewModel) IsFiltering() bool {
|
|||
// used for type switch
|
||||
func (self *FileTreeViewModel) IsFilterableContext() {}
|
||||
|
||||
func (self *FileTreeViewModel) FilterPrefix(tr *i18n.TranslationSet) string {
|
||||
return tr.FilterPrefix
|
||||
}
|
||||
|
||||
func (self *FileTreeViewModel) GetSearchHistory() *utils.HistoryBuffer[string] {
|
||||
return self.searchHistory
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import (
|
|||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
"github.com/jesseduffield/lazygit/pkg/gocui"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/patch_exploring"
|
||||
"github.com/jesseduffield/lazygit/pkg/i18n"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
"github.com/sasha-s/go-deadlock"
|
||||
)
|
||||
|
|
@ -140,7 +139,6 @@ type IFilterableContext interface {
|
|||
ReApplyFilter(bool)
|
||||
IsFiltering() bool
|
||||
IsFilterableContext()
|
||||
FilterPrefix(tr *i18n.TranslationSet) string
|
||||
}
|
||||
|
||||
type ISearchableContext interface {
|
||||
|
|
|
|||
Loading…
Reference in a new issue