From c53939cdfe136338076ed3ea0155d37363fa9709 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Tue, 31 Dec 2019 11:25:55 +0530 Subject: [PATCH] Subtract length of powerline symbols from prompt length max length. --- plugins/path_powerline.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/path_powerline.sh b/plugins/path_powerline.sh index bd4430b..5b725a7 100644 --- a/plugins/path_powerline.sh +++ b/plugins/path_powerline.sh @@ -24,7 +24,7 @@ function wish_path_lensum() { function wish_path_powerline_shrink() { local IFS='/' local path=( $1 ) - local max=$2 + local max=$(( $2 - 3 * ${#path[@]} )) for ((i=0; i <$((${#path[@]} - 1)); i++)); do path[$i]=${path[$i]:0:1} if [[ $(wish_path_lensum ${path[@]}) -lt $max ]]; then