diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-30 20:34:59 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-17 19:13:40 +1100 |
commit | c703cd8f88bfac616cf6bc8a5f8eea41363ddfae (patch) | |
tree | ea3d73e2dc6bf1e72dd4588898d85ed6956a15ef | |
parent | 0a8cff6ab68dc92b98136c4ebe5c6bc7f8f1b3c7 (diff) |
fix suggestions panel
-rw-r--r-- | pkg/gui/confirmation_panel.go | 8 | ||||
-rw-r--r-- | pkg/gui/keybindings.go | 15 |
2 files changed, 18 insertions, 5 deletions
diff --git a/pkg/gui/confirmation_panel.go b/pkg/gui/confirmation_panel.go index d136b7d7f..8ed16ea39 100644 --- a/pkg/gui/confirmation_panel.go +++ b/pkg/gui/confirmation_panel.go @@ -230,25 +230,25 @@ func (gui *Gui) setKeyBindings(opts types.CreatePopupPanelOpts) error { }, { ViewName: "suggestions", - Contexts: []string{string(context.CONFIRMATION_CONTEXT_KEY)}, + Contexts: []string{string(context.SUGGESTIONS_CONTEXT_KEY)}, Key: gui.getKey(keybindingConfig.Universal.Confirm), Handler: onSuggestionConfirm, }, { ViewName: "suggestions", - Contexts: []string{string(context.CONFIRMATION_CONTEXT_KEY)}, + Contexts: []string{string(context.SUGGESTIONS_CONTEXT_KEY)}, Key: gui.getKey(keybindingConfig.Universal.ConfirmAlt1), Handler: onSuggestionConfirm, }, { ViewName: "suggestions", - Contexts: []string{string(context.CONFIRMATION_CONTEXT_KEY)}, + Contexts: []string{string(context.SUGGESTIONS_CONTEXT_KEY)}, Key: gui.getKey(keybindingConfig.Universal.Return), Handler: gui.wrappedConfirmationFunction(opts.HandlersManageFocus, opts.HandleClose), }, { ViewName: "suggestions", - Contexts: []string{string(context.CONFIRMATION_CONTEXT_KEY)}, + Contexts: []string{string(context.SUGGESTIONS_CONTEXT_KEY)}, Key: gui.getKey(keybindingConfig.Universal.TogglePanel), Handler: func() error { return gui.replaceContext(gui.State.Contexts.Confirmation) }, }, diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 123e6f5b5..e6ba31923 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -1496,5 +1496,18 @@ func (gui *Gui) SetKeybinding(binding *types.Binding) error { } func isMouseKey(key interface{}) bool { - return key == gocui.MouseLeft || key == gocui.MouseRight || key == gocui.MouseMiddle || key == gocui.MouseRelease || key == gocui.MouseWheelUp || key == gocui.MouseWheelDown || key == gocui.MouseWheelLeft || key == gocui.MouseWheelRight + switch key { + case + gocui.MouseLeft, + gocui.MouseRight, + gocui.MouseMiddle, + gocui.MouseRelease, + gocui.MouseWheelUp, + gocui.MouseWheelDown, + gocui.MouseWheelLeft, + gocui.MouseWheelRight: + return true + default: + return false + } } |