about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Commands/_expand_word11
-rw-r--r--Completion/Core/_expand1
2 files changed, 10 insertions, 2 deletions
diff --git a/Completion/Commands/_expand_word b/Completion/Commands/_expand_word
index fddd065ee..4ff24c3f5 100644
--- a/Completion/Commands/_expand_word
+++ b/Completion/Commands/_expand_word
@@ -6,6 +6,7 @@ setopt localoptions nullglob rcexpandparam extendedglob noshglob
 unsetopt markdirs globsubst shwordsplit nounset ksharrays
 
 local curcontext="$curcontext"
+local -ah completers
 
 if [[ -z "$curcontext" ]]; then
   curcontext="expand-word:::"
@@ -13,4 +14,12 @@ else
   curcontext="expand-word:${curcontext#*:}"
 fi
 
-_main_complete _expand
+if zstyle -t ":completion:${curcontext}:" completions; then
+    zstyle -a ":completion:${curcontext}:" completer completers
+    completers[1,(i)_expand]=_expand
+    (( $#completers == 1 )) && completers=(_expand _complete)
+else
+    completers=(_expand)
+fi
+
+_main_complete $completers
diff --git a/Completion/Core/_expand b/Completion/Core/_expand
index 9e7d3d122..d47251c5a 100644
--- a/Completion/Core/_expand
+++ b/Completion/Core/_expand
@@ -23,7 +23,6 @@ local exp word sort expr expl subd suf=" " force opt asp tmp opre pre epre
 if [[ "$force" = *c* ]] ||
    zstyle -t ":completion:${curcontext}:" completions; then
   compstate[insert]=all
-  [[ "$curcontext" = expand-word:* ]] && _complete && return 0
   return 1
 fi