todo.txt-cli icon indicating copy to clipboard operation
todo.txt-cli copied to clipboard

prepend remove the status done on done tasks

Open Flyounet opened this issue 7 years ago • 1 comments

Hi,

Thanks for the tool. I want to fill a bug regarding the prepend functionnality.

What is the current behavior? When you prepend on a done task, not yet moved in the done.txt, the text added move the task as todo.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  • Create a task
  • Mark the task as done
  • Prepend something on the done task
$; todo add "testing task"
16 2018-11-26 testing task
TODO: 16 added.

$; todo ls testing
16 2018-11-26 testing task
--
TODO: 1 of 16 tasks shown

$; todo do 16
16 x 2018-11-26 2018-11-26 testing task
TODO: 16 marked as done.

$; todo ls testing
16 x 2018-11-26 2018-11-26 testing task
--
TODO: 1 of 16 tasks shown

$; todo prepend 16 "test again"
16 test again x 2018-11-26 2018-11-26 testing task

$; todo ls testing
16 test again x 2018-11-26 2018-11-26 testing task
--
TODO: 1 of 16 tasks shown

What is the expected behavior? After prepending text the done task should remains done :

Taking the above example, the task should be :

16 x 2018-11-26 2018-11-26 test again testing task

Which versions todo.sh are you using?

Run todo.sh -V TODO.TXT Command Line Interface v2.11.0

Which Operating System are you using? GNU/Linux

Which version of bash are you using?

Run bash --version GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)

What to change in the code ? I suppose we should replace

local -r priAndDateExpr='^\((.) \)\{0,1\}\([0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} \)\{0,1\}'

by

local -r priAndDateExpr='^\((.) \|[xX] \)\{0,1\}\(\([0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} \)\{0,2\}\)'

Flyounet avatar Nov 26 '18 08:11 Flyounet

That shouldn't be done indeed. I suppose it could be checked if the task is done before prepending, so that this can be turned of altogether or prepended after the x.

chrysle avatar Mar 05 '23 08:03 chrysle