about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Zsh/Type/_command_names8
-rw-r--r--Completion/Zsh/Type/_functions8
-rw-r--r--Completion/Zsh/Type/_parameters8
3 files changed, 18 insertions, 6 deletions
diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names
index f57d05226..1f2af5700 100644
--- a/Completion/Zsh/Type/_command_names
+++ b/Completion/Zsh/Type/_command_names
@@ -4,10 +4,14 @@
 # complete only external commands and executable files. This and a
 # `-' as the first argument is then removed from the arguments.
 
-local args defs
+local args defs ffilt
 
 zstyle -t ":completion:${curcontext}:commands" rehash && rehash
 
+zstyle -t ":completion:${curcontext}:functions" prefix-needed && \
+ [[ $PREFIX != [_.]* ]] && \
+ ffilt='[(I)[^_.]*]'
+
 defs=(
   'commands:external command:_path_commands'
 )
@@ -24,7 +28,7 @@ else
 
   defs=( "$defs[@]"
     'builtins:builtin command:compadd -k builtins'
-    'functions:shell function:compadd -k functions'
+    "functions:shell function:compadd -k functions$ffilt"
     'aliases:alias:compadd -k aliases'
     'suffix-aliases:suffix alias:_suffix_alias_files'
     'reserved-words:reserved word:compadd -k reswords'
diff --git a/Completion/Zsh/Type/_functions b/Completion/Zsh/Type/_functions
index 912a7f134..4d336695d 100644
--- a/Completion/Zsh/Type/_functions
+++ b/Completion/Zsh/Type/_functions
@@ -1,5 +1,9 @@
 #compdef unfunction
 
-local expl
+local expl ffilt
 
-_wanted functions expl 'shell function' compadd -k "$@" - functions
+zstyle -t ":completion:${curcontext}:functions" prefix-needed && \
+ [[ $PREFIX != [_.]* ]] && \
+ ffilt='[(I)[^_.]*]'
+
+_wanted functions expl 'shell function' compadd -k "$@" - "functions$ffilt"
diff --git a/Completion/Zsh/Type/_parameters b/Completion/Zsh/Type/_parameters
index 097a96760..5156e3e2d 100644
--- a/Completion/Zsh/Type/_parameters
+++ b/Completion/Zsh/Type/_parameters
@@ -6,7 +6,7 @@
 # If you specify a -g option with a pattern, the pattern will be used to
 # restrict the type of parameters matched.
 
-local expl pattern fakes faked tmp
+local expl pattern fakes faked tmp pfilt
 
 pattern=(-g \*)
 zparseopts -D -K -E g:=pattern
@@ -23,8 +23,12 @@ if zstyle -a ":completion:${curcontext}:" fake-parameters tmp; then
   done
 fi
 
+zstyle -t ":completion:${curcontext}:parameters" prefix-needed && \
+ [[ $PREFIX != [_.]* ]] && \
+ pfilt='[^_.]'
+
 _wanted parameters expl parameter \
     compadd "$@" -Q - \
-        "${(@k)parameters[(R)${pattern[2]}~*local*]}" \
+        "${(@M)${(@k)parameters[(R)${pattern[2]}~*local*]}:#${~pfilt}*}" \
         "$fakes[@]" \
         "${(@)${(@M)faked:#${~pattern[2]}}%%:*}"