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

Re: Test failures in artih and arguments



Bart Schaefer wrote:

> [ making `foo -<TAB>' with `_arguments -x :arg:' not complete the
>   option ]

Here's a simple patch which seems to work for me. It uses $compstate
to keep the code from inserting matches and also handles faked
matches.

At least it should be good enough as a first implementation.


Bye
  Sven

Index: Completion/Base/Core/_message
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Core/_message,v
retrieving revision 1.4
diff -u -r1.4 _message
--- Completion/Base/Core/_message	25 Feb 2002 09:09:35 -0000	1.4
+++ Completion/Base/Core/_message	25 Feb 2002 09:11:10 -0000
@@ -18,6 +18,8 @@
     ret=0
   done
 
+  (( $compstate[nmatches] )) || compstate[insert]=
+
   return ret
 fi
 
Index: Test/Y03arguments.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/Y03arguments.ztst,v
retrieving revision 1.4
diff -u -r1.4 Y03arguments.ztst
--- Test/Y03arguments.ztst	22 Aug 2001 15:59:27 -0000	1.4
+++ Test/Y03arguments.ztst	25 Feb 2002 09:11:10 -0000
@@ -91,7 +91,7 @@
  comptest $'tst -\t'
 0:argument beginning with minus
 >line: {tst -}{}
->MESSAGE:{arg}
+>DESCRIPTION:{arg}
 >DESCRIPTION:{option}
 >NO:{-x}
 

-- 
Sven Wischnowsky                          wischnow@xxxxxxxxx



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