issue-20: Added binding action for prompting for tables

At the moment, this is not bound to anything
This commit is contained in:
Leon Mika 2022-09-03 09:41:47 +10:00
parent 5f76836166
commit 454fcf2eae
2 changed files with 5 additions and 0 deletions

View file

@ -24,6 +24,7 @@ type ViewKeyBindings struct {
Rescan key.Binding `keymap:"rescan"`
PromptForQuery key.Binding `keymap:"prompt-for-query"`
PromptForFilter key.Binding `keymap:"prompt-for-filter"`
PromptForTable key.Binding `keymap:"prompt-for-table"`
ViewBack key.Binding `keymap:"view-back"`
ViewForward key.Binding `keymap:"view-forward"`
CycleLayoutForward key.Binding `keymap:"cycle-layout-forward"`

View file

@ -227,6 +227,10 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
// return m, nil
case key.Matches(msg, m.keyMap.PromptForCommand):
return m, m.commandController.Prompt
case key.Matches(msg, m.keyMap.PromptForTable):
return m, func() tea.Msg {
return m.tableReadController.ListTables()
}
case key.Matches(msg, m.keyMap.Quit):
return m, tea.Quit
}