1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-06-14 19:31:43 +00:00

Added helper functions.

This commit is contained in:
Sorin Ionescu
2011-07-28 16:41:39 -04:00
parent 90da5fc874
commit 9c24ac8211
6 changed files with 63 additions and 13 deletions

View File

@ -85,27 +85,27 @@ function git-prompt-status() {
fi
while IFS=$'\n' read line; do
if [[ "$line" == \?\?\ * ]] && [[ untracked != 'yes' ]]; then
if [[ "$line" == \?\?\ * ]] && ! check-bool "$untracked"; then
untracked='yes'
indicators="${ZSH_THEME_GIT_PROMPT_UNTRACKED}${indicators}"
fi
if [[ "$line" == (((A|M|D|T) )|(AD|AM|AT|MM))\ * ]] && [[ added != 'yes' ]]; then
if [[ "$line" == (((A|M|D|T) )|(AD|AM|AT|MM))\ * ]] && ! check-bool "$added"; then
added='yes'
indicators="${ZSH_THEME_GIT_PROMPT_ADDED}${indicators}"
fi
if [[ "$line" == (( (M|T))|(AM|AT|MM))\ * ]] && [[ modified != 'yes' ]]; then
if [[ "$line" == (( (M|T))|(AM|AT|MM))\ * ]] && ! check-bool "$modified"; then
modified='yes'
indicators="${ZSH_THEME_GIT_PROMPT_MODIFIED}${indicators}"
fi
if [[ "$line" == R\ \ * ]] && [[ renamed != 'yes' ]]; then
if [[ "$line" == R\ \ * ]] && ! check-bool "$renamed"; then
renamed='yes'
indicators="${ZSH_THEME_GIT_PROMPT_RENAMED}${indicators}"
fi
if [[ "$line" == ( D|AD)\ * ]] && [[ deleted != 'yes' ]]; then
if [[ "$line" == ( D|AD)\ * ]] && ! check-bool "$deleted"; then
deleted='yes'
indicators="${ZSH_THEME_GIT_PROMPT_DELETED}${indicators}"
fi
if [[ "$line" == UU\ * ]] && [[ unmerged != 'yes' ]]; then
if [[ "$line" == UU\ * ]] && ! check-bool "$unmerged"; then
unmerged='yes'
indicators="${ZSH_THEME_GIT_PROMPT_UNMERGED}${indicators}"
fi