mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-06-13 04:56:30 +02:00
49645: when completing for the path_dirs option, add a / suffix and follow symlinks
This commit is contained in:
parent
78c51b34c0
commit
7791a6876c
|
@ -1,5 +1,8 @@
|
||||||
2021-12-13 Oliver Kiddle <opk@zsh.org>
|
2021-12-13 Oliver Kiddle <opk@zsh.org>
|
||||||
|
|
||||||
|
* 49645: Completion/Unix/Type/_path_commands: when completing for
|
||||||
|
the path_dirs option, add a / suffix and follow symlinks
|
||||||
|
|
||||||
* 49643: Completion/Zsh/Type/_command_names: facilitate use
|
* 49643: Completion/Zsh/Type/_command_names: facilitate use
|
||||||
of the fake style by always calling _description with the
|
of the fake style by always calling _description with the
|
||||||
executables tag
|
executables tag
|
||||||
|
|
|
@ -87,18 +87,19 @@ fi
|
||||||
# 'if' block move up to the "_command_names -" branch of _command_names?
|
# 'if' block move up to the "_command_names -" branch of _command_names?
|
||||||
if [[ -o path_dirs ]]; then
|
if [[ -o path_dirs ]]; then
|
||||||
local -a path_dirs
|
local -a path_dirs
|
||||||
path_dirs=(${^path}/*(/N:t))
|
|
||||||
(( ${#path_dirs} )) &&
|
|
||||||
_wanted path-dirs expl 'directory in path' compadd "$@" -a path_dirs && ret=0
|
|
||||||
|
|
||||||
if [[ $PREFIX$SUFFIX = */* ]]; then
|
if [[ $PREFIX$SUFFIX = */* ]]; then
|
||||||
|
path_dirs=( ${path:#.} )
|
||||||
# Find command from path, not hashed
|
# Find command from path, not hashed
|
||||||
_wanted commands expl 'external command' _path_files -W path -g '*(*)' &&
|
_wanted commands expl 'external command' _path_files -W path_dirs -g '*(-*)' && ret=0
|
||||||
ret=0
|
else
|
||||||
|
path_dirs=(${^path}/*(/N:t))
|
||||||
|
(( ${#path_dirs} )) &&
|
||||||
|
_wanted path-dirs expl 'directory in path' compadd "$@" -S / -a path_dirs && ret=0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return $ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
_path_commands "$@"
|
_path_commands "$@"
|
||||||
|
|
Loading…
Reference in New Issue