From 13fddc0756c5e58167c5a9e830f1d827fae317c0 Mon Sep 17 00:00:00 2001 From: pomdtr Date: Mon, 20 Nov 2023 02:17:11 +0100 Subject: [PATCH] add alt+enter shortcut --- internal/tui/statusbar.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/internal/tui/statusbar.go b/internal/tui/statusbar.go index 14db1b38..b446a425 100644 --- a/internal/tui/statusbar.go +++ b/internal/tui/statusbar.go @@ -69,13 +69,23 @@ func (p StatusBar) Update(msg tea.Msg) (StatusBar, tea.Cmd) { if len(p.actions) == 0 { return p, nil } + action := p.actions[p.cursor] p.expanded = false p.cursor = 0 - return p, func() tea.Msg { return action } + case "alt+enter": + if p.cursor != 0 || len(p.actions) < 2 { + break + } + + p.expanded = false + p.cursor = 0 + return p, func() tea.Msg { + return p.actions[1] + } case "ctrl+d": if p.expanded { break @@ -132,6 +142,8 @@ func (c StatusBar) View() string { var subtitle string if i == 0 { subtitle = "enter" + } else if i == 1 { + subtitle = "alt+enter" } else if action.Key != "" { subtitle = fmt.Sprintf("alt+%s", action.Key) }