diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-12-30 23:24:24 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-04-30 13:19:52 +1000 |
commit | 8edad826caf2fa48bfad33f9f8c4f3ba49a052da (patch) | |
tree | 0b49145e4f656e72441199b5a5c30176c898d7a7 /pkg/gui/controllers/suggestions_controller.go | |
parent | 826128a8e03fb50f7287029ebac93c85712faecb (diff) |
Begin refactoring gui
This begins a big refactor of moving more code out of the Gui struct into contexts, controllers, and helpers. We also move some code into structs in the
gui package purely for the sake of better encapsulation
Diffstat (limited to 'pkg/gui/controllers/suggestions_controller.go')
-rw-r--r-- | pkg/gui/controllers/suggestions_controller.go | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/pkg/gui/controllers/suggestions_controller.go b/pkg/gui/controllers/suggestions_controller.go new file mode 100644 index 000000000..aaa4c8647 --- /dev/null +++ b/pkg/gui/controllers/suggestions_controller.go @@ -0,0 +1,43 @@ +package controllers + +import ( + "github.com/jesseduffield/lazygit/pkg/gui/context" + "github.com/jesseduffield/lazygit/pkg/gui/types" +) + +type SuggestionsController struct { + baseController + *controllerCommon +} + +var _ types.IController = &SuggestionsController{} + +func NewSuggestionsController( + common *controllerCommon, +) *SuggestionsController { + return &SuggestionsController{ + baseController: baseController{}, + controllerCommon: common, + } +} + +func (self *SuggestionsController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding { + bindings := []*types.Binding{} + + return bindings +} + +func (self *SuggestionsController) GetOnFocusLost() func(types.OnFocusLostOpts) error { + return func(types.OnFocusLostOpts) error { + deactivateConfirmationPrompt + return nil + } +} + +func (self *SuggestionsController) Context() types.Context { + return self.context() +} + +func (self *SuggestionsController) context() *context.SuggestionsContext { + return self.contexts.Suggestions +} |