zsh-workers
 help / color / mirror / code / Atom feed
* [patch] Associative array suffix in command position
@ 2018-07-18 11:54 Matthew Martin
  0 siblings, 0 replies; only message in thread
From: Matthew Martin @ 2018-07-18 11:54 UTC (permalink / raw)
  To: zsh-workers

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
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-07-18 11:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-18 11:54 [patch] Associative array suffix in command position Matthew Martin

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).