Zsh: Early return in _shrunkpwd()
This commit is contained in:
parent
5e22f6cea1
commit
2e4cfd99e0
@ -95,6 +95,10 @@ function _shrunkpwd()
|
||||
{
|
||||
local dir=${(D)PWD}
|
||||
local -i maxwidth=$(( ${COLUMNS} / 3 ))
|
||||
if [[ ${#dir} -le ${maxwidth} ]]; then
|
||||
print -n ${dir}
|
||||
return
|
||||
fi
|
||||
|
||||
local -a shortdir=(${(s:/:)dir})
|
||||
for index in {2..${#shortdir}}; do
|
||||
|
Loading…
x
Reference in New Issue
Block a user