zsh-workers
 help / color / mirror / code / Atom feed
* Re: compctl -l with non-empty argument.
@ 1999-06-16  6:37 Sven Wischnowsky
  1999-06-16  6:44 ` Tanaka Akira
  0 siblings, 1 reply; 3+ messages in thread
From: Sven Wischnowsky @ 1999-06-16  6:37 UTC (permalink / raw)
  To: zsh-workers


Tanaka Akira wrote:

> After above operation, compctl -L print follows.
> 
> is27e1u11% compctl -L
> compctl -k '(a b c)' aaa
> compctl -l bbb bbb
> compctl -C -c -tn
> compctl -D -f -tn
> compctl -T
> 
> Hmm. Argument for -l is replaced...

Hm, I can't reproduce this. Could you try the patch below and tell us
if it works?

Bye
 Sven

diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Wed Jun 16 08:22:35 1999
+++ Src/Zle/zle_tricky.c	Wed Jun 16 08:31:46 1999
@@ -6507,7 +6507,7 @@
     if (cc->subcmd) {
 	/* Handle -l sub-completion. */
 	char **ow = clwords, *os = cmdstr, *ops = NULL;
-	int oldn = clwnum, oldp = clwpos;
+	int oldn = clwnum, oldp = clwpos, br;
 	unsigned long occ = ccont;
 	
 	ccont = CC_CCCONT;
@@ -6523,21 +6523,22 @@
 	    erange = 1;
 	clwnum = erange - brange + 1;
 	clwpos = clwpos - brange;
-	
+	br = brange;
+
 	if (cc->subcmd[0]) {
 	    /* And probably put the command name given to the flag *
 	     * in the array.                                       */
 	    clwpos++;
 	    clwnum++;
 	    incmd = 0;
-	    ops = clwords[brange - 1];
-	    clwords[brange - 1] = cc->subcmd;
+	    ops = clwords[br - 1];
+	    clwords[br - 1] = ztrdup(cc->subcmd);
 	    cmdstr = ztrdup(cc->subcmd);
-	    clwords += brange - 1;
+	    clwords += br - 1;
 	} else {
-	    cmdstr = ztrdup(clwords[brange]);
+	    cmdstr = ztrdup(clwords[br]);
 	    incmd = !clwpos;
-	    clwords += brange;
+	    clwords += br;
 	}
 	/* Produce the matches. */
 	makecomplistcmd(s, incmd, CFN_FIRST);
@@ -6548,8 +6549,10 @@
 	cmdstr = os;
 	clwnum = oldn;
 	clwpos = oldp;
-	if (ops)
-	    clwords[brange - 1] = ops;
+	if (ops) {
+	    zsfree(clwords[br - 1]);
+	    clwords[br - 1] = ops;
+	}
 	ccont = occ;
     }
     if (cc->substr)

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


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

* Re: compctl -l with non-empty argument.
  1999-06-16  6:37 compctl -l with non-empty argument Sven Wischnowsky
@ 1999-06-16  6:44 ` Tanaka Akira
  0 siblings, 0 replies; 3+ messages in thread
From: Tanaka Akira @ 1999-06-16  6:44 UTC (permalink / raw)
  To: zsh-workers

In article <199906160637.IAA05062@beta.informatik.hu-berlin.de>,
  Sven Wischnowsky <wischnow@informatik.hu-berlin.de> writes:

> Hm, I can't reproduce this. Could you try the patch below and tell us
> if it works?

With the patch, zsh works well.
Thanks.
-- 
Tanaka Akira


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

* compctl -l with non-empty argument.
@ 1999-06-15 16:45 Tanaka Akira
  0 siblings, 0 replies; 3+ messages in thread
From: Tanaka Akira @ 1999-06-15 16:45 UTC (permalink / raw)
  To: zsh-workers

Z(2):akr@is27e1u11% zsh-3.1.5-pws-22 -f
is27e1u11% compctl -k '(a b c)' aaa
is27e1u11% compctl -l aaa bbb
is27e1u11% compctl -L
compctl -k '(a b c)' aaa
compctl -l aaa bbb
compctl -C -c -tn
compctl -D -f -tn
compctl -T
is27e1u11% bbb <TAB><TAB>

After first <TAB>, I get completion candidates "a", "b" and "c"
successfully. But after second <TAB>, I get no completion instead of
"a" generating by automenu.

After above operation, compctl -L print follows.

is27e1u11% compctl -L
compctl -k '(a b c)' aaa
compctl -l bbb bbb
compctl -C -c -tn
compctl -D -f -tn
compctl -T

Hmm. Argument for -l is replaced...
-- 
Tanaka Akira


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

end of thread, other threads:[~1999-06-16  6:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-16  6:37 compctl -l with non-empty argument Sven Wischnowsky
1999-06-16  6:44 ` Tanaka Akira
  -- strict thread matches above, loose matches on Subject: below --
1999-06-15 16:45 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).