Use ANSI color codes instead of the zsh builtin %F{}

This commit is contained in:
xylous 2021-05-30 11:14:41 +03:00
parent 88430f3835
commit 208cfc43ee

6
gitstatus.plugin.zsh Normal file → Executable file
View File

@ -71,9 +71,9 @@ function parse_git_status() {
&& GIT_DELETED="-${deleted_files} " && GIT_DELETED="-${deleted_files} "
(( ${untracked_files} > 0 )) \ (( ${untracked_files} > 0 )) \
&& GIT_UNTRACKED="?${untracked_files}" && GIT_UNTRACKED="?${untracked_files}"
local fg_special='%F{yellow}' local fg_special=$'\e[0;33m'
else else
local fg_special='%F{34}' local fg_special=$'\e[01;32m'
fi fi
GIT_STATUS="${fg_special}" GIT_STATUS="${fg_special}"
@ -81,7 +81,7 @@ function parse_git_status() {
GIT_STATUS+="${GIT_COMMITS_STATUS}" GIT_STATUS+="${GIT_COMMITS_STATUS}"
GIT_STATUS+="${GIT_MODIFIED}${GIT_STAGED}" GIT_STATUS+="${GIT_MODIFIED}${GIT_STAGED}"
GIT_STATUS+="${GIT_DELETED}${GIT_UNTRACKED}" GIT_STATUS+="${GIT_DELETED}${GIT_UNTRACKED}"
GIT_STATUS+="${FG_CLR}" GIT_STATUS+=$'\e[0m'
# Remove trailing whitespace # Remove trailing whitespace
GIT_STATUS="$(sed 's/[ ]+$//' <<<"$GIT_STATUS")" GIT_STATUS="$(sed 's/[ ]+$//' <<<"$GIT_STATUS")"