From f8254ba89a5172e9d0f0876af6a7b1b9d3450268 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Sun, 22 Dec 2019 18:45:07 +0530 Subject: [PATCH] Add checks for adding powerline to right prompt --- wish.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/wish.sh b/wish.sh index e590fe7..8fff68a 100644 --- a/wish.sh +++ b/wish.sh @@ -141,17 +141,19 @@ function wish_main() { WISH_STATE=1 WISH_RPL=0 for i in $(seq 0 $((${#WISH_RIGHT_PLUGINS[@]} - 1))); do - if [[ -v WISH_POWERLINE && WISH_POWERLINE != 0 ]]; then - if [[ $i == 0 ]]; then - local plugin=${WISH_RIGHT_PLUGINS[$i]} - local fg_name="WISH_${plugin^^}_BG" - wish_append -1 ${!fg_name}  - else - local plugin=${WISH_RIGHT_PLUGINS[$i]} - local prev_plugin=${WISH_RIGHT_PLUGINS[$(($i-1))]} - local fg_name="WISH_${plugin^^}_BG" - local bg_name="WISH_${prev_plugin^^}_BG" - wish_append ${!bg_name} ${!fg_name}  + if [[ -v WISH_POWERLINE ]] && [[ $WISH_POWERLINE != 0 ]]; then + if wish_${WISH_RIGHT_PLUGINS[$i]}_end $prev; then + if [[ $i == 0 ]]; then + local plugin=${WISH_RIGHT_PLUGINS[$i]} + local fg_name="WISH_${plugin^^}_BG" + wish_append -1 ${!fg_name}  + elif wish_${WISH_RIGHT_PLUGINS[$(($i - 1))]}_start $prev; then + local plugin=${WISH_RIGHT_PLUGINS[$i]} + local prev_plugin=${WISH_RIGHT_PLUGINS[$(($i-1))]} + local fg_name="WISH_${plugin^^}_BG" + local bg_name="WISH_${prev_plugin^^}_BG" + wish_append ${!bg_name} ${!fg_name}  + fi fi fi wish_${WISH_RIGHT_PLUGINS[$i]}_main $prev