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

Re: other _arguments problems



Tanaka Akira wrote:

> I found two other _arguments problems when I wrote _psutils.
> 
> Z(2):akr@is27e1u11% Src/zsh -f
> is27e1u11% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst
> is27e1u11% zstyle ':completion*:messages' format '%d'
> is27e1u11% _tst () { _arguments '-x:arg:' }
> is27e1u11% tst -x<TAB>
> no arguments
> 
> It should insert ` '.

A missing re-activation of the option we are on.

> is27e1u11% _tst () { _arguments '-x' ':arg:' }
> is27e1u11% tst -<TAB>
> arg
> 
> It should insert `x '.

A result of 9452 which has been fixed by other means in the meantime.

Bye
 Sven

diff -ru ../z.old/Completion/Base/_arguments Completion/Base/_arguments
--- ../z.old/Completion/Base/_arguments	Mon Feb 14 11:28:56 2000
+++ Completion/Base/_arguments	Mon Feb 14 11:49:04 2000
@@ -254,7 +254,7 @@
         fi
       fi
 
-      if [[ -z "$matched$mesg" ]] && _requested options &&
+      if [[ -z "$matched" ]] && _requested options &&
           { ! zstyle -t ":completion:${curcontext}:options" prefix-needed ||
           [[ "$origpre" = [-+]* ||
              ( -z "$aret$mesg" && nm -eq compstate[nmatches] ) ]] } ; then
diff -ru ../z.old/Src/Zle/computil.c Src/Zle/computil.c
--- ../z.old/Src/Zle/computil.c	Mon Feb 14 11:29:26 2000
+++ Src/Zle/computil.c	Mon Feb 14 11:41:44 2000
@@ -1261,6 +1261,7 @@
 		    ca_laststate.ddef = ddef;
 		    ca_laststate.def = NULL;
 		    ca_laststate.opt = 1;
+		    state.curopt->active = 1;
 		} else {
 		    ca_laststate.doff = doff;
 		    ca_laststate.opt = 0;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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