From ba958c42ebb79298aad061bfc9ca5c04dee16b55 Mon Sep 17 00:00:00 2001 From: chieping Date: Fri, 10 Apr 2015 23:21:00 +0900 Subject: [PATCH] fix rbenv_prompt_info prefix/suffix --- plugins/rbenv/rbenv.plugin.zsh | 6 +++--- themes/jonathan.zsh-theme | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh index 213e1beb..c0fb287d 100644 --- a/plugins/rbenv/rbenv.plugin.zsh +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -44,9 +44,9 @@ for rbenvdir in "${rbenvdirs[@]}" ; do function rbenv_prompt_info() { 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 - echo "$(current_ruby)" + echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}$(current_ruby)${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}" fi } fi @@ -56,5 +56,5 @@ unset rbenvdir if [ $FOUND_RBENV -eq 0 ] ; then alias rubies='ruby -v' 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 diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme index 2f0e7743..118ef13d 100644 --- a/themes/jonathan.zsh-theme +++ b/themes/jonathan.zsh-theme @@ -12,7 +12,7 @@ function theme_precmd { PR_PWDLEN="" 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 pwdsize=${#${(%):-%~}}