about summary refs log tree commit diff
path: root/Completion/Core
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/Core
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/Core')
-rw-r--r--Completion/Core/_description2
-rw-r--r--Completion/Core/_expand8
2 files changed, 7 insertions, 3 deletions
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.