Added new wd function to powerline-flies theme. Changed the __powerline_prompt_command function to reflect the base function.

This commit is contained in:
Dan Flies
2017-12-08 09:22:35 -06:00
parent fae18112cb
commit 35c29349bd
2 changed files with 14 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
. "$BASH_IT/themes/powerline/powerline.base.bash"
function __powerline_cwd_prompt {
function __powerline_wd_prompt {
echo "\W|${CWD_THEME_PROMPT_COLOR}"
}
@@ -15,8 +15,11 @@ function __powerline_left_segment {
function __powerline_prompt_command {
local last_status="$?" ## always the first
local separator_char="${POWERLINE_PROMPT_CHAR}"
LEFT_PROMPT=""
SEGMENTS_AT_LEFT=0
LAST_SEGMENT_COLOR=""
## left prompt ##
for segment in $POWERLINE_PROMPT; do
@@ -24,10 +27,12 @@ function __powerline_prompt_command {
[[ -n "${info}" ]] && __powerline_left_segment "${info}"
done
[[ "${last_status}" -ne 0 ]] && __powerline_left_segment $(__powerline_last_status_prompt ${last_status})
[[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -) ${normal}"
[[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -)${separator_char}${normal}"
PS1="${LEFT_PROMPT} "
PS1="${LEFT_PROMPT}"
## cleanup ##
unset LEFT_PROMPT
unset LAST_SEGMENT_COLOR \
LEFT_PROMPT \
SEGMENTS_AT_LEFT
}