summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/suggestions_controller.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-03-21 20:57:52 +1100
committerJesse Duffield <jessedduffield@gmail.com>2023-04-30 13:19:53 +1000
commit509e3efa70512ed34b90177eb17d6481664bb958 (patch)
tree663333126d6764706462271712583e4c8e93d786 /pkg/gui/controllers/suggestions_controller.go
parent8edad826caf2fa48bfad33f9f8c4f3ba49a052da (diff)
lots more refactoring
Diffstat (limited to 'pkg/gui/controllers/suggestions_controller.go')
-rw-r--r--pkg/gui/controllers/suggestions_controller.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/pkg/gui/controllers/suggestions_controller.go b/pkg/gui/controllers/suggestions_controller.go
index aaa4c8647..ca8a488a7 100644
--- a/pkg/gui/controllers/suggestions_controller.go
+++ b/pkg/gui/controllers/suggestions_controller.go
@@ -22,14 +22,27 @@ func NewSuggestionsController(
}
func (self *SuggestionsController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding {
- bindings := []*types.Binding{}
+ bindings := []*types.Binding{
+ {
+ Key: opts.GetKey(opts.Config.Universal.Confirm),
+ Handler: func() error { return self.context().State.OnConfirm() },
+ },
+ {
+ Key: opts.GetKey(opts.Config.Universal.Return),
+ Handler: func() error { return self.context().State.OnClose() },
+ },
+ {
+ Key: opts.GetKey(opts.Config.Universal.TogglePanel),
+ Handler: func() error { return self.c.ReplaceContext(self.contexts.Confirmation) },
+ },
+ }
return bindings
}
func (self *SuggestionsController) GetOnFocusLost() func(types.OnFocusLostOpts) error {
return func(types.OnFocusLostOpts) error {
- deactivateConfirmationPrompt
+ self.helpers.Confirmation.DeactivateConfirmationPrompt()
return nil
}
}