diff options
| author | ewy <ewy0@protonmail.com> | 2026-04-29 00:47:34 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-04-29 00:47:34 +0200 |
| commit | 630d77e1962b43ee95e88a664f5e8b8993213060 (patch) | |
| tree | 8849c2a87443cd231786aed53b76dc7e4ea11aed /menu/input.go | |
| parent | 8efcf029576ad82908b4ae80b2c92022dfb857d2 (diff) | |
big stuff
* send empty screen after tui confirmation
* add scroll view / viewport
* auto enable scroll view on short terminals
* add motd tips
* add subdirs as categories
* add inline toggle hotkey (i)
Diffstat (limited to 'menu/input.go')
| -rw-r--r-- | menu/input.go | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/menu/input.go b/menu/input.go index 6d05749..cd07543 100644 --- a/menu/input.go +++ b/menu/input.go @@ -5,6 +5,16 @@ import tea "github.com/charmbracelet/bubbletea" func (m *Model) HandleInput(msg tea.KeyMsg) (tea.Cmd, error) { var cmd tea.Cmd switch msg.String() { + case "i", "I": + if m.Alt { + m.Alt = false + m.AutoAlt = false + return tea.ExitAltScreen, nil + } else { + m.Alt = true + m.AutoAlt = false + return tea.EnterAltScreen, nil + } case "h", "left": m.Leap(-1) case "l", "right": @@ -14,10 +24,11 @@ func (m *Model) HandleInput(msg tea.KeyMsg) (tea.Cmd, error) { case "down", "j": m.Index++ case "q", "esc", "ctrl+c": - m.Quit = true - cmd = tea.Quit + m.Cancel = true + return tea.Quit, nil case "space", " ", "enter", "ctrl+d": - cmd = tea.Quit + m.Done = true + return tea.Quit, nil } m.Validate() |
