1
0
Fork 0

Move git-prompt from plugin/ to lib/ because it needs to be auto loaded prior to the theme being loaded.

pull/1/head
Ashley Dev 14 years ago
parent 541b16d931
commit bf56eadc22

@ -28,17 +28,13 @@
# # GIT_PROMPT_INFO_FUNC must be set to the # # GIT_PROMPT_INFO_FUNC must be set to the
# # function that defines your prompt info # # function that defines your prompt info
# # in order to turn the git-prompt plugin on. # # in order to turn the git-prompt plugin on.
# # $ZSH/lib/git-prompt.zsh will cause
# # $GIT_PROMPT_INFO_FUNC to be called when the
# # git prompt info needs to be updated.
# GIT_PROMPT_INFO_FUNC='update__GIT_PROMPT_INFO' # GIT_PROMPT_INFO_FUNC='update__GIT_PROMPT_INFO'
# #
# GIT_PROMPT_SHOWUPSTREAM="verbose" # GIT_PROMPT_SHOWUPSTREAM="verbose"
# #
# if [[ -z $__git_prompt_loaded__ &&
# -f $ZSH/plugins/git-prompt/git-prompt.plugin.zsh ]];
# then
# source $ZSH/plugins/git-prompt/git-prompt.plugin.zsh
# fi
#
#
# # Some color settings for the format # # Some color settings for the format
# # '_C' for color: # # '_C' for color:
# local _Cerror_="%{$fg[yellow]%}" # bad (empty) .git/ directory # local _Cerror_="%{$fg[yellow]%}" # bad (empty) .git/ directory
@ -426,7 +422,7 @@ __git_stash_state ()
# This is the short-circuit logic: # This is the short-circuit logic:
local _big_repo='init' local _big_repo='init'
TRAPINT() __git_prompt_shortcircuit ()
{ {
if [[ "$_big_repo" == 'yes' ]]; then if [[ "$_big_repo" == 'yes' ]]; then
_big_repo='' _big_repo=''
@ -444,8 +440,13 @@ TRAPINT()
$GIT_PROMPT_INFO_FUNC $GIT_PROMPT_INFO_FUNC
fi fi
fi fi
}
TRAPINT ()
{
__git_prompt_shortcircuit
return $(( 128 + $1 )) return $(( 128 + $1 ))
} }
__git_dirty_state () __git_dirty_state ()
{ {
GIT_PROMPT_DIRTY_STATE_FRESH_REPO='' GIT_PROMPT_DIRTY_STATE_FRESH_REPO=''
@ -599,4 +600,3 @@ preexec_update_git_vars ()
} }
#-------------------------------------------------- #--------------------------------------------------
__git_prompt_loaded__='yes'

@ -25,13 +25,12 @@ MODE_INDICATOR="%{$fg_bold[cyan]%}-- CMD MODE -- $R"
#----------------------------------------------------- #-----------------------------------------------------
# git prompt info: # git prompt info:
# $ZSH/lib/git-prompt.zsh will cause $GIT_PROMPT_INFO_FUNC to be called
# when the git prompt info needs to be updated.
GIT_PROMPT_INFO_FUNC="update__GIT_PROMPT_INFO"
GIT_PROMPT_SHOWUPSTREAM="verbose" GIT_PROMPT_SHOWUPSTREAM="verbose"
GIT_PROMPT_SHORTCIRCUIT='on' GIT_PROMPT_SHORTCIRCUIT='on'
GIT_PROMPT_INFO_FUNC="update__GIT_PROMPT_INFO"
if [[ -z $__git_prompt_loaded__ &&
-f $ZSH/plugins/git-prompt/git-prompt.plugin.zsh ]]; then
source $ZSH/plugins/git-prompt/git-prompt.plugin.zsh
fi
# git_prompt_info colors ('_C' for color): # git_prompt_info colors ('_C' for color):
local _Cerror_="%{$fg[yellow]%}" # bad (empty) .git/ directory local _Cerror_="%{$fg[yellow]%}" # bad (empty) .git/ directory

Loading…
Cancel
Save