51470 (tweaked, c.f. 51476): Separate cdpath elements in path-directories completion

This commit is contained in:
Sebastian Stark 2023-02-21 23:12:47 +01:00 committed by Oliver Kiddle
parent f604645d06
commit bb36b80178
2 changed files with 13 additions and 2 deletions

View file

@ -1,5 +1,9 @@
2023-02-24 Oliver Kiddle <opk@zsh.org>
* Sebastian Stark: 51470 (tweaked, c.f. 51476):
Completion/Zsh/Command/_cd: Separate cdpath elements in
path-directories completion
* 51474: Completion/Unix/Command/_ansible: make -e and --vault-id
options repeatable and update for new options to ansible 2.13.2

View file

@ -70,8 +70,15 @@ else
tmpcdpath=(${${(@)cdpath:#.}:#$PWD})
(( $#tmpcdpath )) &&
alt=( 'path-directories:directory in cdpath:_path_files -W tmpcdpath -/' )
if zstyle -t ":completion:${curcontext}:path-directories" separate-sections; then
local elem
for ((elem=1; elem <= $#tmpcdpath; elem++)); do
alt+=( "path-directories-$elem:directory in $tmpcdpath[$elem]:_path_files -W 'tmpcdpath[$elem]' -/" )
done
else
(( $#tmpcdpath )) &&
alt=( 'path-directories:directory in cdpath:_path_files -W tmpcdpath -/' )
fi
# With cdablevars, we can complete foo as if ~foo/
if [[ -o cdablevars && -n "$PREFIX" && "$PREFIX" != <-> ]]; then