zsh-workers
 help / Atom feed
* [PATCH] Fix `_description -J`
@ 2019-09-18  9:15 dana
  0 siblings, 0 replies; 1+ messages in thread
From: dana @ 2019-09-18  9:15 UTC (permalink / raw)
  To: Zsh hackers list; +Cc: Oliver Kiddle

I noticed that workers/44274 introduced a bug related to `_description -J`.
When invoked this way, the function now adds -J to expl twice, yielding
something like...

  -J -J foo -X 'completing foo:'

... which breaks completion.

Can we simply do this? My brain is too muddy right now to understand the full
implications, but it seems like it should work...?

(Can't remember why i actually wanted to use `_description -J`; just found it
in one of my functions)

dana


diff --git a/Completion/Base/Core/_description b/Completion/Base/Core/_description
index c2a0e080b..bdb4007a6 100644
--- a/Completion/Base/Core/_description
+++ b/Completion/Base/Core/_description
@@ -1,13 +1,13 @@
 #autoload
 
 local name nopt xopt format gname hidden hide match opts tag
-local -a gropt sort
+local -a ign gropt sort
 
 opts=()
 
 xopt=(-X)
 nopt=()
-zparseopts -K -D -a nopt 1 2 V=gropt J x=xopt
+zparseopts -K -D -a nopt 1 2 V=gropt J=ign x=xopt
 
 3="${${3##[[:blank:]]#}%%[[:blank:]]#}"
 [[ -n "$3" ]] && _lastdescr=( "$_lastdescr[@]" "$3" )


^ permalink raw reply	[flat|nested] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18  9:15 [PATCH] Fix `_description -J` dana

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/ public-inbox