mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-10 00:31:07 +02:00
zsh-workers/9149
This commit is contained in:
parent
df6b4aadbb
commit
aac49ecdbd
2 changed files with 6 additions and 2 deletions
|
@ -37,9 +37,11 @@ elif _popd || [[ $PREFIX != (\~|/|./|../)* && $#cdpath -ne 0 ]]; then
|
||||||
PREFIX="~$PREFIX"
|
PREFIX="~$PREFIX"
|
||||||
_path_files -/
|
_path_files -/
|
||||||
else
|
else
|
||||||
|
local tmpcdpath
|
||||||
|
tmpcdpath=(${(@)cdpath:#.})
|
||||||
_alternative \
|
_alternative \
|
||||||
'local-directories:local directories:_path_files -/' \
|
'local-directories:local directories:_path_files -/' \
|
||||||
"path-directories: directories in cdpath:_path_files -W \\(${${(@)cdpath:#.}}\\) -/"
|
"path-directories:directories in cdpath:_path_files -W tmpcdpath -/"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
_path_files -/
|
_path_files -/
|
||||||
|
|
|
@ -44,7 +44,9 @@ while getopts "P:S:qr:R:W:F:J:V:X:f/g:M:12n" opt; do
|
||||||
if [[ "$tmp1[1]" = '(' ]]; then
|
if [[ "$tmp1[1]" = '(' ]]; then
|
||||||
prepaths=( ${^=tmp1[2,-2]%/}/ )
|
prepaths=( ${^=tmp1[2,-2]%/}/ )
|
||||||
else
|
else
|
||||||
prepaths=( ${(P)^=tmp1%/}/ )
|
# In this case the variable should be an array, so
|
||||||
|
# don't use an extra ${=...}.
|
||||||
|
prepaths=( ${(P)^tmp1%/}/ )
|
||||||
(( ! $#prepaths )) && prepaths=( ${tmp1%/}/ )
|
(( ! $#prepaths )) && prepaths=( ${tmp1%/}/ )
|
||||||
fi
|
fi
|
||||||
(( ! $#prepaths )) && prepaths=( '' )
|
(( ! $#prepaths )) && prepaths=( '' )
|
||||||
|
|
Loading…
Reference in a new issue