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

Re: PATCH: _xwit



Tanaka Akira wrote:

> ...
> 
> But, this doesn't work because [[ -prefix [0-9]# ]] is failed even
> when $PREFIX is empty:
> 
> Z(2):akr@is27e1u11% Src/zsh -f
> is27e1u11% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst
> is27e1u11% _tst () { if [[ -prefix [0-9]# ]]; then compadd succ; else compadd fail; fi } 
> is27e1u11% tst <TAB>
> ->
> is27e1u11% tst fail 

Oops. Wrong security test.

Bye
 Sven

diff -ru ../z.old/Src/Zle/complete.c Src/Zle/complete.c
--- ../z.old/Src/Zle/complete.c	Mon Mar 27 12:49:45 2000
+++ Src/Zle/complete.c	Mon Mar 27 12:58:11 2000
@@ -740,7 +740,7 @@
 		char *p, sav;
 
 		if (!(l = strlen(compprefix)))
-		    return 0;
+		    return ((na == 1 || na == -1) && pattry(pp, compprefix));
 		if (na < 0) {
 		    p = compprefix + l;
 		    na = -na;
@@ -766,7 +766,7 @@
 		char *p;
 
 		if (!(ol = l = strlen(compsuffix)))
-		    return 0;
+		    return ((na == 1 || na == -1) && pattry(pp, compsuffix));
 		if (na < 0) {
 		    p = compsuffix;
 		    na = -na;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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