BUG: listpri picked up non-priority patterns.

The regexp for the priority wasn't anchored to the beginning of the task. (As the filtering is done inside the _list pipeline, the task number has already been prepended.)
Also, by passing the regexp directly to _list, a case-insensitive search was performed, so despite [A-Z], lowercase characters were picked up, too. Need to make use of post_filter_command to inject a separate, case-sensitive grep into the pipeline.

Bonus: Added test for highlighting of listpri command.
This commit is contained in:
Ingo Karkat
2011-05-10 15:20:29 +02:00
parent a830f18dd5
commit c429b062cf
2 changed files with 44 additions and 2 deletions

View File

@@ -1022,9 +1022,9 @@ note: PRIORITY must a single letter from A to Z."
## No priority specified; show all priority tasks
pri="[A-Z]"
fi
pri="($pri)"
_list "$TODO_FILE" "$pri"
post_filter_command="grep '^ *[0-9]\+ (${pri}) '"
_list "$TODO_FILE"
;;
"move" | "mv" )