Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[patch] Associative array suffix in command position



When completing an associative array in the command position = is used
as the suffix. I think it's more likely (at least in my own usage) that
the user only wants to change a single key not the entire array. Thus
use [ as the suffix not =. There could be a zstyle knob to pick = or [,
but I don't think it'd be used.  So unless someone speaks up, I'm
inclined to omit the knob.

- Matthew Martin


diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names
index 940f341cb..96ea57687 100644
--- a/Completion/Zsh/Type/_command_names
+++ b/Completion/Zsh/Type/_command_names
@@ -31,7 +31,8 @@ else
     'suffix-aliases:suffix alias:_suffix_alias_files'
     'reserved-words:reserved word:compadd -Qk reswords'
     'jobs:: _jobs -t'
-    'parameters:: _parameters -g "^*readonly*" -qS= -r "\n\t\- =["'
+    'parameters:: _parameters -g "^*(readonly|association)*" -qS= -r "\n\t\- =["'
+    'parameters:: _parameters -g "*association*~*readonly*" -qS\[ -r "\n\t\- =["'
   )
 fi
 



Messages sorted by: Reverse Date, Date, Thread, Author