about summary refs log tree commit diff
path: root/Completion/Core/_expand
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-02-03 17:22:40 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-02-03 17:22:40 +0000
commited41dafd3c79ebf2ce390ee9af54fe8bb21deb73 (patch)
treea45e062eb30e19f11c04c8bb7d30e36c1b77eb7e /Completion/Core/_expand
parent52a67fbbda1eda1e45d9aa6eed6c9650fbd6d0b1 (diff)
downloadzsh-ed41dafd3c79ebf2ce390ee9af54fe8bb21deb73.tar.gz
zsh-ed41dafd3c79ebf2ce390ee9af54fe8bb21deb73.tar.xz
zsh-ed41dafd3c79ebf2ce390ee9af54fe8bb21deb73.zip
zsh-workers/9546
Diffstat (limited to 'Completion/Core/_expand')
-rw-r--r--Completion/Core/_expand13
1 files changed, 6 insertions, 7 deletions
diff --git a/Completion/Core/_expand b/Completion/Core/_expand
index cdfc2a8d1..b1609ad40 100644
--- a/Completion/Core/_expand
+++ b/Completion/Core/_expand
@@ -7,13 +7,12 @@
 # the expansions done produce no result or do not change the original
 # word from the line.
 
-local exp word="$PREFIX$SUFFIX" sort expr expl curcontext="${curcontext}"
-
-[[ "$curcontext" != :expand* ]] && curcontext="${curcontext}:expand"
+local exp word="$PREFIX$SUFFIX" sort expr expl
+local curcontext="${curcontext/:[^:]#:/:expand:}"
 
 # First, see if we should insert all *completions*.
 
-if zstyle -s ":completion${curcontext}:" completions expr &&
+if zstyle -s ":completion:${curcontext}:" completions expr &&
    [[ "${(e):-\$[$expr]}" -eq 1 ]]; then
   compstate[insert]=all
   return 1
@@ -30,7 +29,7 @@ exp=("$word")
 # First try substitution. That weird thing spanning multiple lines
 # changes quoted spaces, tabs, and newlines into spaces.
 
-zstyle -s ":completion${curcontext}:" substitute expr &&
+zstyle -s ":completion:${curcontext}:" substitute expr &&
     [[ "${(e):-\$[$expr]}" -eq 1 ]] &&
     exp=( "${(e)exp//\\[ 	
 ]/ }" )
@@ -41,7 +40,7 @@ zstyle -s ":completion${curcontext}:" substitute expr &&
 
 # Now try globbing.
 
-zstyle -s ":completion${curcontext}:" glob expr &&
+zstyle -s ":completion:${curcontext}:" glob expr &&
     [[ "${(e):-\$[$expr]}" -eq 1 ]] &&
     exp=( ${~exp}(N) )
 
@@ -53,7 +52,7 @@ zstyle -s ":completion${curcontext}:" glob expr &&
 
 # Now add as matches whatever the user requested.
 
-zstyle -s ":completion${curcontext}:" sort sort
+zstyle -s ":completion:${curcontext}:" sort sort
 
 [[ "$sort" = (yes|true|1|on) ]] && exp=( "${(@o)exp}" )