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

Tasks with no priority sort before prioritized tasks if they start with ASCII char before '(' #279

Open
NightFlyer opened this issue Apr 13, 2019 · 1 comment

Comments

@NightFlyer
Copy link
Contributor

Do you want to request a feature or report a bug?
bug

What is the current behavior?
If you have a task that starts with an ASCII character before '(' (such as # or double quote),
that task will sort before any of the priority tasks. So, what you get are:

  1. unprioritized tasks that start with an ASCII character before '('
  2. prioritized tasks
  3. unprioritized tasks that start ASCII character after '('

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
Use a todo.txt such as the following:

(A) high priority task
(B) medium priority task
"funny" task
Another task
(A) "funny" priority task

then do todo.sh ls will show:

3 "funny" task
5 (A) "funny" priority task
1 (A) high priority task
2 (B) medium priority task
4 Another task

What is the expected behavior?
The expected behavior is that all unprioritized tasks will sort after prioritized tasks.

5 (A) "funny" priority task
1 (A) high priority task
2 (B) medium priority task
3 "funny" task
4 Another 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?
MacOS 10.13.6

Which version of bash are you using?

Run bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)

@the1ts
Copy link
Contributor

the1ts commented Jul 3, 2021

This appears to be because of the LC_COLLATE=C in the default TODOTXT_SORT_COMMAND.
You can try setting this in your todo.cfg to remove it. Seems to ignore non-alphanumeric characters and allow the priority sorting.
TODOTXT_SORT_COMMAND="sort -f -k2"

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