about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-19 09:55:31 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-19 09:55:31 +0000
commita295e82c1e3c6d10cd873d0fcd31ed45d77e4ca3 (patch)
treeeb354def4bb31fa8dc1fd6a2b8a178d1f1936f7c /Completion
parent2769b198812abf82cc3b074852714959213f266a (diff)
downloadzsh-a295e82c1e3c6d10cd873d0fcd31ed45d77e4ca3.tar.gz
zsh-a295e82c1e3c6d10cd873d0fcd31ed45d77e4ca3.tar.xz
zsh-a295e82c1e3c6d10cd873d0fcd31ed45d77e4ca3.zip
allow _expand to expand braces; better detection of braces to complete in C (11973)
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Builtins/_zstyle43
-rw-r--r--Completion/Core/_description2
-rw-r--r--Completion/Core/_expand8
3 files changed, 42 insertions, 11 deletions
diff --git a/Completion/Builtins/_zstyle b/Completion/Builtins/_zstyle
index db86829ec..764afb5a1 100644
--- a/Completion/Builtins/_zstyle
+++ b/Completion/Builtins/_zstyle
@@ -17,31 +17,32 @@ styles=(
   break-keys             c:
   command                c:command
   completer		 c:completer
-  completions		 c:
-  condition		 c:
+  completions		 c:bool
+  condition		 c:bool
   cursor		 c:cursor
   disable-stat		 c:bool
   domains                c:
   expand		 c:
+  fake			 c:fake
   file-patterns		 c:filepat
   file-sort              c:fsort
-  force-list             c
+  force-list             c:
   format		 c:
-  glob			 c:
+  glob			 c:bool
   group-name		 c:
   group-order		 c:tag
   groups		 c:_groups
-  guarded-completer      c:completer
   hidden		 c:bool
   hosts			 c:_hosts
   hosts-ports		 c:host-port
   users-hosts-ports	 c:user-host-port
-  ignore-line            c:bool
+  ignore-line            c:ignline
   ignore-parents         c:ignorepar
   ignored-patterns	 c:
   insert-ids             c:insert-ids
   insert-tab             c:bool
   insert-unambiguous	 c:bool
+  keep-prefix		 c:keep-prefix
   last-prompt		 c:bool
   list			 c:listwhen
   list-colors		 c:
@@ -49,6 +50,8 @@ styles=(
   list-prompt            c:
   list-rows-first	 c:bool
   local			 c:
+  match-original	 c:match-orig
+  matcher		 c:
   matcher-list		 c:
   max-errors		 c:
   menu			 c:boolauto
@@ -62,6 +65,7 @@ styles=(
   prefix-hidden		 c:bool
   prefix-needed		 c:bool
   prompt		 c:
+  remote-access		 c:bool
   remove-all-dups	 c:bool
   select-prompt          c:
   select-scroll          c:
@@ -71,9 +75,12 @@ styles=(
   squeeze-slashes	 c:bool
   stop			 c:stop
   stop-keys		 c:
-  subst-globs-only       c:
-  substitute		 c:
+  subst-globs-only       c:bool
+  substitute		 c:bool
+  suffix		 c:bool
   tag-order		 c:tag
+  try-to-use-pminst	 c:bool
+  use-compctl		 c:urgh
   users			 c:_users
   users-hosts		 c:user-host
   verbose		 c:bool
@@ -256,6 +263,26 @@ while [[ -n $state ]]; do
           compadd - menu single longer
       ;;
 
+    fake)
+      _message 'prefix and names'
+      ;;
+
+    ignline) 
+      _wanted values expl boolean compadd true false current current-shown other
+      ;;
+
+    keep-prefix) 
+      _wanted values expl boolean compadd true false changed
+      ;;
+
+    match-orig) 
+      _wanted values expl boolean compadd only both
+      ;;
+
+    urgh) 
+      _wanted values expl no compadd no false off 0
+      ;;
+
     _*)
       ${=ostate}
       ;;
diff --git a/Completion/Core/_description b/Completion/Core/_description
index b1b98741c..2c4232ade 100644
--- a/Completion/Core/_description
+++ b/Completion/Core/_description
@@ -38,6 +38,8 @@ if [[ -z "$_comp_no_ignore" ]]; then
     case "$hidden" in
     true|yes|on|1) _comp_ignore=( "$_comp_ignore[@]" "$words[@]" );;
     current)       _comp_ignore=( "$_comp_ignore[@]" "$words[CURRENT]" );;
+    current-shown) [[ "$compstate[old_list]" = *shown* ]] &&
+                       _comp_ignore=( "$_comp_ignore[@]" "$words[CURRENT]" );;
     other)         _comp_ignore=( "$_comp_ignore[@]"
                                   "${(@)words[1,CURRENT-1]}"
 				  "${(@)words[CURRENT+1,-1]}" );;
diff --git a/Completion/Core/_expand b/Completion/Core/_expand
index 88a2fb97d..8b0bae95f 100644
--- a/Completion/Core/_expand
+++ b/Completion/Core/_expand
@@ -55,10 +55,12 @@ exp=("$word")
 
 if [[ "$force" = *s* ]] ||
    zstyle -T ":completion:${curcontext}:" substitute; then
-  exp=( "${(e)exp//\\[ 	
-]/ }" )
+  [[ ! -o ignorebraces && "${#${exp}//[^\{]}" = "${#${exp}//[^\}]}" ]] &&
+      eval exp\=\( ${${(q)exp}:gs/\\{/\{/:gs/\\}/\}/} \)
+  exp=( ${(e)exp//\\[ 	
+]/ } )
 else
-  exp=( "${exp:s/\\\$/\$}" )
+  exp=( ${exp:s/\\\$/\$} )
 fi
 
 # If the array is empty, store the original string again.