Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepend remove the status done on done tasks #268

Open
Flyounet opened this issue Nov 26, 2018 · 1 comment
Open

prepend remove the status done on done tasks #268

Flyounet opened this issue Nov 26, 2018 · 1 comment

Comments

@Flyounet
Copy link

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\}\)'
@chrysle
Copy link
Contributor

chrysle commented Mar 5, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants