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:
@@ -111,6 +111,10 @@ func (pane *ProjectPane) addSection(name string) {
|
||||
|
||||
func (pane *ProjectPane) 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 'n':
|
||||
app.SetFocus(pane.newProject)
|
||||
}
|
||||
|
||||
@@ -259,9 +259,9 @@ func (td *TaskDetailPane) editInExternalEditor() {
|
||||
td.SetTask(td.task)
|
||||
}
|
||||
|
||||
app.ForceDraw()
|
||||
// @TODO: Not working - fix it
|
||||
app.EnableMouse(true)
|
||||
// @TODO: Mouse events not being captured after returning from Suspend - fix it
|
||||
// app.EnableMouse(true).
|
||||
|
||||
_ = os.Remove(tmpFileName)
|
||||
|
||||
// app.SetFocus(td)
|
||||
@@ -298,6 +298,8 @@ func (td *TaskDetailPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey
|
||||
td.editInExternalEditor()
|
||||
case 'd':
|
||||
app.SetFocus(td.taskDate)
|
||||
case 'h':
|
||||
app.SetFocus(taskPane)
|
||||
case ' ':
|
||||
td.toggleTaskStatus()
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user