about summary refs log tree commit diff
path: root/Completion/Core/_expand
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Core/_expand')
-rw-r--r--Completion/Core/_expand8
1 files changed, 5 insertions, 3 deletions
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.