From 593ebcddca74fc27c5bcc213378bae5777914ac0 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Sat, 7 Sep 2024 16:06:59 +0300 Subject: [PATCH] feat(main): make empty / go to root --- README.md | 2 +- src/main.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e68493a..3aecf29 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ To stop time-tracking completely, simply move to the root of all tasks. + match by task name prefix: if one or more tasks match, filter / activate (tries case-sensitive then case-insensitive) + no match: create & activate task - `.2` - set view depth to the given number (how many subtask levels to show, default is 1) -- `/[TEXT]` - activate task or filter by smart-case substring match +- `/[TEXT]` - activate task or filter by smart-case substring match (empty: move to root) - `||TASK` - create and activate a new task procedure (where subtasks automatically depend on the previously created task) - `|[TASK]` - (un)mark current task as procedure or create a sibling task depending on the current one and move up diff --git a/src/main.rs b/src/main.rs index aeda770..802c863 100644 --- a/src/main.rs +++ b/src/main.rs @@ -632,7 +632,9 @@ async fn main() -> Result<()> { } } - Some('/') => { + Some('/') => if arg.is_none() { + tasks.move_to(None); + } else { let mut dots = 1; let mut pos = tasks.get_position_ref(); for _ in iter.take_while(|c| c == &'/') {