1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-06-14 08:41: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

@ -2,14 +2,14 @@
# FILE: compleat.plugin.zsh
# DESCRIPTION: oh-my-zsh plugin file.
# AUTHOR: Sorin Ionescu <sorin.ionescu@gmail.com>
# VERSION: 1.0.1
# VERSION: 1.0.2
# ------------------------------------------------------------------------------
if (( ${+commands[compleat]} )); then
compleat_setup="${commands[compleat]:h:h}/share/compleat-1.0/compleat_setup"
if [[ -f "$compleat_setup" ]]; then
if ! bashcompinit >/dev/null 2>&1; then
if autoloadable bashcompinit; then
autoload -Uz bashcompinit && bashcompinit
fi

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