1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

lots more refactoring

This commit is contained in:
Jesse Duffield
2023-03-21 20:57:52 +11:00
parent 8edad826ca
commit 509e3efa70
45 changed files with 779 additions and 729 deletions

View File

@ -6,6 +6,7 @@ import (
"github.com/jesseduffield/generics/slices"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/gui/context"
"github.com/jesseduffield/lazygit/pkg/gui/presentation"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/jesseduffield/lazygit/pkg/utils"
@ -35,8 +36,8 @@ type ISuggestionsHelper interface {
type SuggestionsHelper struct {
c *types.HelperCommon
model *types.Model
refreshSuggestionsFn func()
model *types.Model
contexts *context.ContextTree
}
var _ ISuggestionsHelper = &SuggestionsHelper{}
@ -44,12 +45,12 @@ var _ ISuggestionsHelper = &SuggestionsHelper{}
func NewSuggestionsHelper(
c *types.HelperCommon,
model *types.Model,
refreshSuggestionsFn func(),
contexts *context.ContextTree,
) *SuggestionsHelper {
return &SuggestionsHelper{
c: c,
model: model,
refreshSuggestionsFn: refreshSuggestionsFn,
c: c,
model: model,
contexts: contexts,
}
}
@ -127,7 +128,7 @@ func (self *SuggestionsHelper) GetFilePathSuggestionsFunc() func(string) []*type
// cache the trie for future use
self.model.FilesTrie = trie
self.refreshSuggestionsFn()
self.contexts.Suggestions.RefreshSuggestions()
return err
})