mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
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
This commit is contained in:
43
pkg/gui/controllers/suggestions_controller.go
Normal file
43
pkg/gui/controllers/suggestions_controller.go
Normal file
@ -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
|
||||
}
|
Reference in New Issue
Block a user