From a92fca6f8e326d72b5041281341093473f5a1fa4 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Sun, 27 Jan 2002 21:57:52 +0000 Subject: 16500: don't complete executable files in the current directory if "." is not in path. --- Completion/Zsh/Type/_command_names | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Completion/Zsh') diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names index 006006348..71c3adfd2 100644 --- a/Completion/Zsh/Type/_command_names +++ b/Completion/Zsh/Type/_command_names @@ -8,9 +8,18 @@ local args defs defs=( 'commands:external command:compadd -k commands' - 'executables:executable file or directory:_path_files -/g \*\(-\*\)' ) +if [[ -n "$path[(r).]" ]]; then + defs=( "$defs[@]" + 'executables:executable file or directory:_path_files -/g \*\(-\*\)' + ) +else + defs=( "$defs[@]" + 'executables:executable file or directory:_files -P/ -W/ -/g \*\(-\*\)' + ) +fi + if [[ "$1" = -e ]]; then shift else -- cgit 1.4.1