optionally colorized date extensions (due, threshold and again)
This commit is contained in:
10
todo.sh
10
todo.sh
@@ -644,9 +644,10 @@ export PRI_B=$GREEN # color for B priority
|
||||
export PRI_C=$LIGHT_BLUE # color for C priority
|
||||
export PRI_X=$WHITE # color unless explicitly defined
|
||||
|
||||
# Default project and context colors.
|
||||
# Default project, context and dateext colors.
|
||||
export COLOR_PROJECT=$NONE
|
||||
export COLOR_CONTEXT=$NONE
|
||||
export COLOR_DATEEXT=$NONE
|
||||
|
||||
# Default highlight colors.
|
||||
export COLOR_DONE=$LIGHT_GREY # color for done (but not yet archived) tasks
|
||||
@@ -964,6 +965,9 @@ _format()
|
||||
ctx_beg = highlight("COLOR_CONTEXT")
|
||||
ctx_end = (ctx_beg ? (highlight("DEFAULT") clr) : "")
|
||||
|
||||
dtx_beg = highlight("COLOR_DATEEXT")
|
||||
dtx_end = (dtx_beg ? (highlight("DEFAULT") clr) : "")
|
||||
|
||||
gsub(/[ \t][ \t]*/, "\n&\n")
|
||||
len = split($0, words, /\n/)
|
||||
|
||||
@@ -973,7 +977,9 @@ _format()
|
||||
printf "%s", prj_beg words[i] prj_end
|
||||
} else if (words[i] ~ /^[@].*[A-Za-z0-9_]$/) {
|
||||
printf "%s", ctx_beg words[i] ctx_end
|
||||
} else {
|
||||
} else if (words[i] ~ /^(due|t|again):/) {
|
||||
printf "%s", dtx_beg words[i] dtx_end
|
||||
} else {
|
||||
printf "%s", words[i]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user