This commit is contained in:
tastytea 2022-04-22 23:09:11 +02:00
parent a170e34344
commit 164ea811ce
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM

View File

@ -103,7 +103,7 @@ function _shrunkpwd()
# Maybe shorten all elements but the first and last # Maybe shorten all elements but the first and last
local -a short_dir=(${(s:/:)dir}) local -a short_dir=(${(s:/:)dir})
local -i allowed_element_width=$(( ${max_width} / ${#short_dir} -1 )) local -i allowed_element_width=$(( ${max_width} / ${#short_dir} - 1 ))
for index in {2..$(( ${#short_dir} - 1 ))}; do for index in {2..$(( ${#short_dir} - 1 ))}; do
if [[ ${#short_dir[index]} -gt ${allowed_element_width} ]] && \ if [[ ${#short_dir[index]} -gt ${allowed_element_width} ]] && \
[[ ${#${(j:/:)short_dir}} -gt ${max_width} ]]; then [[ ${#${(j:/:)short_dir}} -gt ${max_width} ]]; then