diff --git a/common/keymap.go b/common/keymap.go index 1356c9d..887534d 100644 --- a/common/keymap.go +++ b/common/keymap.go @@ -17,6 +17,8 @@ type Keymap struct { Down key.Binding Left key.Binding Right key.Binding + Next key.Binding + Prev key.Binding SetReport key.Binding SetContext key.Binding SetProject key.Binding @@ -86,6 +88,16 @@ func NewKeymap() *Keymap { key.WithHelp("→/l", "Right"), ), + Next: key.NewBinding( + key.WithKeys("tab"), + key.WithHelp("tab", "Next"), + ), + + Prev: key.NewBinding( + key.WithKeys("shift+tab"), + key.WithHelp("shift+tab", "Previous"), + ), + SetReport: key.NewBinding( key.WithKeys("r"), key.WithHelp("r", "Set report"), diff --git a/pages/taskEditor.go b/pages/taskEditor.go index c304316..ebdf78d 100644 --- a/pages/taskEditor.go +++ b/pages/taskEditor.go @@ -174,6 +174,26 @@ func (p *TaskEditorPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch { case key.Matches(msg, p.common.Keymap.Back): return p, changeMode(modeNormal) + case key.Matches(msg, p.common.Keymap.Prev): + var cmd tea.Cmd + if p.columnCursor == 0 { + picker, cmd := p.areaPicker.Update(msg) + p.areaPicker = picker.(*areaPicker) + return p, cmd + } else { + p.areas[p.area], cmd = p.areas[p.area].Update(prevFieldMsg{}) + return p, cmd + } + case key.Matches(msg, p.common.Keymap.Next): + var cmd tea.Cmd + if p.columnCursor == 0 { + picker, cmd := p.areaPicker.Update(msg) + p.areaPicker = picker.(*areaPicker) + return p, cmd + } else { + p.areas[p.area], cmd = p.areas[p.area].Update(nextFieldMsg{}) + return p, cmd + } case key.Matches(msg, p.common.Keymap.Ok): area, cmd := p.areas[p.area].Update(msg) p.areas[p.area] = area diff --git a/test/taskchampion.sqlite3 b/test/taskchampion.sqlite3 index 637f62a..f53a801 100644 Binary files a/test/taskchampion.sqlite3 and b/test/taskchampion.sqlite3 differ