Refactor __powerline_last_status_prompt function

pull/605/head
Eduardo Bellido Bellido 2016-01-30 12:19:34 +01:00
parent f6436a878e
commit 30c6fd1f59
1 changed files with 3 additions and 9 deletions

View File

@ -160,11 +160,7 @@ function __powerline_in_vim_prompt {
}
function __powerline_last_status_prompt {
if [[ "$1" -eq 0 ]]; then
LAST_STATUS_PROMPT=""
else
LAST_STATUS_PROMPT="$(set_rgb_color ${LAST_STATUS_THEME_PROMPT_COLOR} -) ${1} ${normal}"
fi
[[ "$1" -ne 0 ]] && echo "$(set_rgb_color ${LAST_STATUS_THEME_PROMPT_COLOR} -) ${1} ${normal}"
}
function __powerline_left_segment {
@ -231,12 +227,10 @@ function __powerline_prompt_command {
LEFT_PROMPT+="\033[${RIGHT_PROMPT_LENGTH}D"
fi
__powerline_last_status_prompt "${last_status}"
PS1="${LEFT_PROMPT}${RIGHT_PROMPT}\n${LAST_STATUS_PROMPT}${PROMPT_CHAR} "
PS1="${LEFT_PROMPT}${RIGHT_PROMPT}\n$(__powerline_last_status_prompt ${last_status})${PROMPT_CHAR} "
## cleanup ##
unset LAST_STATUS_PROMPT LAST_SEGMENT_COLOR \
unset LAST_SEGMENT_COLOR \
LEFT_PROMPT RIGHT_PROMPT RIGHT_PROMPT_LENGTH \
SEGMENTS_AT_LEFT SEGMENTS_AT_RIGHT
}