all repos — todo.txt-go @ 9c189ec93227b6c005edbc66f1a83abe842c6285

CLI tool for todo.txt files written in Go

feat: :sparkles: Circular navigation on tasks list
Tim Izzo tim@octree.ch
Sat, 12 Apr 2025 18:02:15 +0200
commit

9c189ec93227b6c005edbc66f1a83abe842c6285

parent

601f4a83a9da7611413da0b9ac67f720ee77b709

2 files changed, 7 insertions(+), 6 deletions(-)

jump to
M README.mdREADME.md

@@ -6,7 +6,8 @@ - [x] Use _todo.txt_ file targeted by todo-txt.sh config

- [x] Implement archive mecanism - [x] Allow task edition - [x] Allow to remove priority on task -- [ ] Circular navigation on tasks +- [x] Circular navigation on tasks +- [ ] Provide config file with argument ## Ressources
M main.gomain.go

@@ -105,14 +105,14 @@

switch { // Navigation case key.Matches(msg, m.keys.Up): - if m.cursor > 0 { - m.cursor-- + newCursor := (m.cursor - 1) % len(m.tasks) + if newCursor < 0 { + newCursor += len(m.tasks) } + m.cursor = newCursor case key.Matches(msg, m.keys.Down): - if m.cursor < len(m.tasks)-1 { - m.cursor++ - } + m.cursor = (m.cursor + 1) % len(m.tasks) // Tasks management case key.Matches(msg, m.keys.Priority):