From 5e7d36a0e888307af678d37a0f180ed316cd050f Mon Sep 17 00:00:00 2001 From: dineshsaini Date: Sat, 20 Nov 2021 15:04:24 +0530 Subject: [PATCH] fixed header prettify code --- annote.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/annote.sh b/annote.sh index 58aa5e6..fcd270a 100755 --- a/annote.sh +++ b/annote.sh @@ -5,7 +5,7 @@ ############################################################################### __NAME__="annote" -__VERSION__="1.09" +__VERSION__="1.10" # variables c_red="$(tput setaf 196)" @@ -724,6 +724,9 @@ function make_header { fmt="$(echo "$fmt" | sed -e "s//$ntitle/g" )" fi done + if [ "x$flag_no_pretty" != "xy" ]; then + fmt="$(on_black "$fmt")" + fi echo -e "$fmt" } @@ -765,7 +768,7 @@ function _list_notes { local nids="$1" local c=0 local l="" - on_black "$(make_header)" + make_header if [ -n "$nids" ]; then for n in `echo "$nids" | tr ',' '\n'`; do if [[ "x$flag_show_archived" = "x" ]] && $(is_archived "$n"); then @@ -807,7 +810,10 @@ function build_header { fmt="$fmt$arg$list_delim" c="$(( ++c ))" done - echo -e "$(on_black "$fmt")" + if [ "x$flag_no_pretty" != "xy" ]; then + fmt="$(on_black "$fmt")" + fi + echo -e "$fmt" } function build_row {