Fix bindings

This commit is contained in:
2023-02-18 02:54:48 -07:00
parent 3f87018dfa
commit 48d22cbb30
+6 -5
View File
@@ -64,18 +64,19 @@ func (m Dashboard) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
} }
case tea.KeyMsg: case tea.KeyMsg:
switch keypress := msg.String(); keypress { switch keypress := msg.String(); keypress {
case "ctrl+c", "q": case "tab":
return m, tea.Quit
case "right", "l", "n", "tab":
m.activeTab = min(m.activeTab+1, len(m.Tabs)-1) m.activeTab = min(m.activeTab+1, len(m.Tabs)-1)
return m, nil return m, nil
case "left", "h", "p", "shift+tab": case "shift+tab":
m.activeTab = max(m.activeTab-1, 0) m.activeTab = max(m.activeTab-1, 0)
return m, nil return m, nil
} }
} }
return m, nil var cmd tea.Cmd
m.TabContent[m.activeTab], cmd = m.TabContent[m.activeTab].Update(msg)
return m, cmd
} }
func (m Dashboard) View() string { func (m Dashboard) View() string {