From f1d339a53795f8d2bcdaa213f6f490b8d48b6433 Mon Sep 17 00:00:00 2001 From: Nick Wilson Date: Sun, 23 Jan 2011 15:40:13 -0800 Subject: [PATCH] Fix substitution for hiding contexts/projects When using the -+ or -@ option to hide project or context names in list output, the color reset sequence was being deleted if the project/context was at the end of the line. For example, with the following tasks: (B) with priority, ending in a +project task that shouldn't be highlighted Running 'todo.sh -+ list' would hide the "+project" from the first task, but would also remove the color reset sequence ^[[0m at the end. The color from the prioritized task would continue to the next lines. This commit fixes the problem and adds a test to verify the fix. --- tests/t1330-ls-highlighting.sh | 18 ++++++++++++++++++ todo.sh | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/t1330-ls-highlighting.sh b/tests/t1330-ls-highlighting.sh index 2cf61a2..aa3db44 100755 --- a/tests/t1330-ls-highlighting.sh +++ b/tests/t1330-ls-highlighting.sh @@ -148,4 +148,22 @@ TODO: 4 marked as done. TODO: 5 of 5 tasks shown EOF +# check highlighting with hidden contexts/projects +# +cat > todo.txt <