fix rbenv_prompt_info prefix/suffix
This commit is contained in:
parent
75b9030f48
commit
ba958c42eb
@ -44,9 +44,9 @@ for rbenvdir in "${rbenvdirs[@]}" ; do
|
|||||||
|
|
||||||
function rbenv_prompt_info() {
|
function rbenv_prompt_info() {
|
||||||
if [[ -n $(current_gemset) ]] ; then
|
if [[ -n $(current_gemset) ]] ; then
|
||||||
echo "$(current_ruby)@$(current_gemset)"
|
echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}$(current_ruby)@$(current_gemset)${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
|
||||||
else
|
else
|
||||||
echo "$(current_ruby)"
|
echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}$(current_ruby)${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
@ -56,5 +56,5 @@ unset rbenvdir
|
|||||||
if [ $FOUND_RBENV -eq 0 ] ; then
|
if [ $FOUND_RBENV -eq 0 ] ; then
|
||||||
alias rubies='ruby -v'
|
alias rubies='ruby -v'
|
||||||
function gemsets() { echo 'not supported' }
|
function gemsets() { echo 'not supported' }
|
||||||
function rbenv_prompt_info() { echo "system: $(ruby -v | cut -f-2 -d ' ')" }
|
function rbenv_prompt_info() { echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}system: $(ruby -v | cut -f-2 -d ' ')${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}" }
|
||||||
fi
|
fi
|
||||||
|
@ -12,7 +12,7 @@ function theme_precmd {
|
|||||||
PR_PWDLEN=""
|
PR_PWDLEN=""
|
||||||
|
|
||||||
local promptsize=${#${(%):---(%n@%m:%l)---()--}}
|
local promptsize=${#${(%):---(%n@%m:%l)---()--}}
|
||||||
local rubyprompt=`rvm_prompt_info || rbenv_prompt_info`
|
local rubyprompt="`rvm_prompt_info || rbenv_prompt_info`"
|
||||||
local rubypromptsize=${#${rubyprompt}}
|
local rubypromptsize=${#${rubyprompt}}
|
||||||
local pwdsize=${#${(%):-%~}}
|
local pwdsize=${#${(%):-%~}}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user