Zsh prompt: Allow to break shrink-path-loop early
This commit is contained in:
parent
164ea811ce
commit
1a16e70e08
@ -105,8 +105,8 @@ function _shrunkpwd()
|
||||
local -a short_dir=(${(s:/:)dir})
|
||||
local -i allowed_element_width=$(( ${max_width} / ${#short_dir} - 1 ))
|
||||
for index in {2..$(( ${#short_dir} - 1 ))}; do
|
||||
if [[ ${#short_dir[index]} -gt ${allowed_element_width} ]] && \
|
||||
[[ ${#${(j:/:)short_dir}} -gt ${max_width} ]]; then
|
||||
if [[ ${#short_dir[index]} -gt ${allowed_element_width} ]]; then
|
||||
[[ ${#${(j:/:)short_dir}} -le ${max_width} ]] && break
|
||||
short_dir[index]=${short_dir[index][1]}
|
||||
fi
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user