summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/menu_controller.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-05-21 11:02:36 +1000
committerJesse Duffield <jessedduffield@gmail.com>2023-05-21 11:31:29 +1000
commite1fc90615d75913c21eb0050e53d4452f9a3b0d0 (patch)
tree426b6c52b1aef43dc26ef46185103d0b3722f7cc /pkg/gui/controllers/menu_controller.go
parent460a166e166ba7bfa67aa7b1758b410930194e3f (diff)
Apply strikethrough style to reserved keybindings in menus
If a given menu item has an associated keybinding of 'enter', hitting enter won't actually execute that item unless your cursor is on it. This creates confusion, and so we're going to use a strikethrough style to communicate that the keybinding is reserved for something else.
Diffstat (limited to 'pkg/gui/controllers/menu_controller.go')
-rw-r--r--pkg/gui/controllers/menu_controller.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/gui/controllers/menu_controller.go b/pkg/gui/controllers/menu_controller.go
index b687778ac..58b0fcdd5 100644
--- a/pkg/gui/controllers/menu_controller.go
+++ b/pkg/gui/controllers/menu_controller.go
@@ -21,6 +21,8 @@ func NewMenuController(
}
}
+// NOTE: if you add a new keybinding here, you'll also need to add it to
+// `reservedKeys` in `pkg/gui/context/menu_context.go`
func (self *MenuController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding {
bindings := []*types.Binding{
{