zsh-workers
 help / color / mirror / code / Atom feed
* Re: compset -P '/'
@ 2000-01-24 10:35 Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 2000-01-24 10:35 UTC (permalink / raw)
  To: zsh-workers


Tanaka Akira wrote:

> I found a problem with completion.
> 
> Z(2):akr@is27e1u11% Src/zsh -f
> is27e1u11% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst
> is27e1u11% rm -rf z
> is27e1u11% mkdir z z/y
> is27e1u11% touch z/a
> is27e1u11% _tst () {
> function> compset -P '/'
> function> _path_files -g '*(^/)'
> function> _path_files -g '*(/)'
> function> }
> is27e1u11% tst /z/<TAB>
> 
> ->
> 
> is27e1u11% tst /
> 
> zsh removes `z/' and the cursor is places on retained `/'.
> But it should complete the file `a' and the directory `y'.

It got confused about the match specs to use... the test the patch
removes only made sense in the compctl code.

> If the prefix is a colon rather than a slash, it works well.
> 
> is27e1u11% _tst () {
> compset -P ':'
> _path_files -g '*(^/)'
> _path_files -g '*(/)'
> }
> is27e1u11% tst :z/<TAB>
> a   y/

Because it didn't have a match spec comparable to `r:|/=*'.

Bye
 Sven

diff -ru ../z.old/Src/Zle/compcore.c Src/Zle/compcore.c
--- ../z.old/Src/Zle/compcore.c	Mon Jan 24 10:55:00 2000
+++ Src/Zle/compcore.c	Mon Jan 24 11:32:21 2000
@@ -1603,8 +1603,7 @@
 		mst.matcher = dat->match;
 		mstack = &mst;
 
-		if (!mnum)
-		    add_bmatchers(dat->match);
+		add_bmatchers(dat->match);
 
 		addlinknode(matchers, dat->match);
 		dat->match->refc++;

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

* compset -P '/'
@ 2000-01-23 11:48 Tanaka Akira
  0 siblings, 0 replies; 2+ messages in thread
From: Tanaka Akira @ 2000-01-23 11:48 UTC (permalink / raw)
  To: zsh-workers

I found a problem with completion.

Z(2):akr@is27e1u11% Src/zsh -f
is27e1u11% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst
is27e1u11% rm -rf z
is27e1u11% mkdir z z/y
is27e1u11% touch z/a
is27e1u11% _tst () {
function> compset -P '/'
function> _path_files -g '*(^/)'
function> _path_files -g '*(/)'
function> }
is27e1u11% tst /z/<TAB>

->

is27e1u11% tst /

zsh removes `z/' and the cursor is places on retained `/'.
But it should complete the file `a' and the directory `y'.

If the prefix is a colon rather than a slash, it works well.

is27e1u11% _tst () {
compset -P ':'
_path_files -g '*(^/)'
_path_files -g '*(/)'
}
is27e1u11% tst :z/<TAB>
a   y/
-- 
Tanaka Akira


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

end of thread, other threads:[~2000-01-24 10:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-24 10:35 compset -P '/' Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2000-01-23 11:48 Tanaka Akira

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).