Gitinfo and pztrn prompt now showing deleted files count.

This commit is contained in:
Stanislav Nikitin 2016-01-04 15:12:50 +05:00
parent a12c9bcff9
commit 2fbecf063d
2 changed files with 4 additions and 1 deletions

View File

@ -4,6 +4,7 @@ GITINFO_COMMIT_SHORTID=""
GITINFO_COMMIT_COUNT=0
GITINFO_NEW_FILES=""
GITINFO_MODIFIED_FILES=""
GITINFO_DELETED_FILES=""
GITINFO_REMOTES=""
GITINFO_STASHES_COUNT=0
@ -87,10 +88,12 @@ function gitinfo_get_changes()
if [ $? -eq 1 ]; then
GITINFO_NEW_FILES=""
GITINFO_MODIFIED_FILES=""
GITINFO_DELETED_FILES=""
return 1
fi
GITINFO_NEW_FILES=`LC_ALL=C git status | grep "new" | wc -l`
GITINFO_MODIFIED_FILES=`LC_ALL=C git status | grep "modified" | wc -l`
GITINFO_DELETED_FILES=`LC_ALL=C git status | grep "deleted" | wc -l`
}
######################################################################

View File

@ -80,7 +80,7 @@ prompt_pztrn_gitinfo()
p_gitinfo_branch="$vars['brackets_start']$vars['usercolor']${GITINFO_BRANCH}$reset_color$vars['brackets_end']"
p_gitinfo_commit="$vars['brackets_start']%{$fg[magenta]%}${GITINFO_COMMIT_SHORTID}$reset_color (%{$fg[cyan]%}${GITINFO_COMMIT_COUNT}$reset_color)$vars['brackets_end']"
p_gitinfo_remotes="$vars['brackets_start']%{$fg[green]%}${GITINFO_REMOTES} remote(s)$reset_color$vars['brackets_end']"
p_gitinfo_files="$vars['brackets_start']%{$fg[green]%}${GITINFO_NEW_FILES}$reset_color new, %{$fg[yellow]%}${GITINFO_MODIFIED_FILES}$reset_color modified$vars['brackets_end']"
p_gitinfo_files="$vars['brackets_start']%{$fg[green]%}${GITINFO_NEW_FILES}$reset_color new, %{$fg[yellow]%}${GITINFO_MODIFIED_FILES}$reset_color modified, %{$fg[red]%}${GITINFO_DELETED_FILES} deleted$vars['brackets_end']"
p_gitinfo=$'\n'"$p_gitinfo_branch$p_gitinfo_commit$p_gitinfo_files$p_gitinfo_remotes"
else
p_gitinfo=""