Add checks for adding powerline to right prompt

This commit is contained in:
Ceda EI 2019-12-22 18:45:07 +05:30
parent b389774a50
commit f8254ba89a
1 changed files with 13 additions and 11 deletions

24
wish.sh
View File

@ -141,17 +141,19 @@ function wish_main() {
WISH_STATE=1 WISH_STATE=1
WISH_RPL=0 WISH_RPL=0
for i in $(seq 0 $((${#WISH_RIGHT_PLUGINS[@]} - 1))); do for i in $(seq 0 $((${#WISH_RIGHT_PLUGINS[@]} - 1))); do
if [[ -v WISH_POWERLINE && WISH_POWERLINE != 0 ]]; then if [[ -v WISH_POWERLINE ]] && [[ $WISH_POWERLINE != 0 ]]; then
if [[ $i == 0 ]]; then if wish_${WISH_RIGHT_PLUGINS[$i]}_end $prev; then
local plugin=${WISH_RIGHT_PLUGINS[$i]} if [[ $i == 0 ]]; then
local fg_name="WISH_${plugin^^}_BG" local plugin=${WISH_RIGHT_PLUGINS[$i]}
wish_append -1 ${!fg_name} local fg_name="WISH_${plugin^^}_BG"
else wish_append -1 ${!fg_name}
local plugin=${WISH_RIGHT_PLUGINS[$i]} elif wish_${WISH_RIGHT_PLUGINS[$(($i - 1))]}_start $prev; then
local prev_plugin=${WISH_RIGHT_PLUGINS[$(($i-1))]} local plugin=${WISH_RIGHT_PLUGINS[$i]}
local fg_name="WISH_${plugin^^}_BG" local prev_plugin=${WISH_RIGHT_PLUGINS[$(($i-1))]}
local bg_name="WISH_${prev_plugin^^}_BG" local fg_name="WISH_${plugin^^}_BG"
wish_append ${!bg_name} ${!fg_name} local bg_name="WISH_${prev_plugin^^}_BG"
wish_append ${!bg_name} ${!fg_name}
fi
fi fi
fi fi
wish_${WISH_RIGHT_PLUGINS[$i]}_main $prev wish_${WISH_RIGHT_PLUGINS[$i]}_main $prev