summary refs log tree commit diff
path: root/Completion/Base
diff options
context:
space:
mode:
authorOliver Kiddle <okiddle@yahoo.co.uk>2015-05-30 11:14:48 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-05-30 11:14:48 -0700
commit4c2a62fe8623c24f3fbb56ed17550c7f02cf9316 (patch)
tree1bd8b355a31f1c94ece32bb5ba02d52e38812d1b /Completion/Base
parente88610b786461f4e7f6a51f084d5aaae0e8ecd85 (diff)
downloadzsh-4c2a62fe8623c24f3fbb56ed17550c7f02cf9316.tar.gz
zsh-4c2a62fe8623c24f3fbb56ed17550c7f02cf9316.tar.xz
zsh-4c2a62fe8623c24f3fbb56ed17550c7f02cf9316.zip
35310 (plus undo 35268 (git 899613f)): fix quoting of cached arrays
Also add file name reference to ChangeLog entry from rev 899613f.
Diffstat (limited to 'Completion/Base')
-rw-r--r--Completion/Base/Utility/_store_cache11
1 files changed, 9 insertions, 2 deletions
diff --git a/Completion/Base/Utility/_store_cache b/Completion/Base/Utility/_store_cache
index 86e72e9a9..fb2ab328a 100644
--- a/Completion/Base/Utility/_store_cache
+++ b/Completion/Base/Utility/_store_cache
@@ -46,8 +46,15 @@ if zstyle -t ":completion:${curcontext}:" use-cache; then
   for var; do
     case ${(Pt)var} in
     (*readonly*) ;;
-    (*(association|array)*) print -r "$var=( ${(kv@Pqq)^^var} )";;
-    (*)                     print -r "$var=${(Pqq)^^var}";;
+    (*(association|array)*)
+	# Dump the array as a here-document to reduce parsing overhead
+	# when reloading the cache with "source" from _retrieve_cache
+	print -r "$var=( "'${(Q)"${(z)$(<<\EO:'"$var"
+	print -r "${(kv@Pqq)^^var}"
+	print -r "EO:$var"
+	print -r ')}"} )'
+	;;
+    (*) print -r "$var=${(Pqq)^^var}";;
     esac
   done >! "$_cache_dir/$_cache_ident"
 else