Added vim style keyboard shortcuts (resolve #2)

- Navigating lists with `j` and `k`
- Moving to panel (task-detail to tasks to projects) with `h`
This commit is contained in:
Anis Ahmad
2020-06-26 22:25:21 +06:00
parent f3637b4598
commit 99527254b3
4 changed files with 51 additions and 8 deletions

View File

@@ -100,6 +100,12 @@ func (pane *TaskPane) addTaskToList(i int) *tview.List {
func (pane *TaskPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey {
switch event.Rune() {
case 'j':
pane.list.SetCurrentItem(pane.list.GetCurrentItem() + 1)
case 'k':
pane.list.SetCurrentItem(pane.list.GetCurrentItem() - 1)
case 'h':
app.SetFocus(projectPane)
case 'n':
app.SetFocus(pane.newTask)
}