Next/Prev task edit
This commit is contained in:
@ -17,6 +17,8 @@ type Keymap struct {
|
|||||||
Down key.Binding
|
Down key.Binding
|
||||||
Left key.Binding
|
Left key.Binding
|
||||||
Right key.Binding
|
Right key.Binding
|
||||||
|
Next key.Binding
|
||||||
|
Prev key.Binding
|
||||||
SetReport key.Binding
|
SetReport key.Binding
|
||||||
SetContext key.Binding
|
SetContext key.Binding
|
||||||
SetProject key.Binding
|
SetProject key.Binding
|
||||||
@ -86,6 +88,16 @@ func NewKeymap() *Keymap {
|
|||||||
key.WithHelp("→/l", "Right"),
|
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(
|
SetReport: key.NewBinding(
|
||||||
key.WithKeys("r"),
|
key.WithKeys("r"),
|
||||||
key.WithHelp("r", "Set report"),
|
key.WithHelp("r", "Set report"),
|
||||||
|
|||||||
@ -174,6 +174,26 @@ func (p *TaskEditorPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
switch {
|
switch {
|
||||||
case key.Matches(msg, p.common.Keymap.Back):
|
case key.Matches(msg, p.common.Keymap.Back):
|
||||||
return p, changeMode(modeNormal)
|
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):
|
case key.Matches(msg, p.common.Keymap.Ok):
|
||||||
area, cmd := p.areas[p.area].Update(msg)
|
area, cmd := p.areas[p.area].Update(msg)
|
||||||
p.areas[p.area] = area
|
p.areas[p.area] = area
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user