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

Re: PATCH: completions for su and implicit fg/bg



Peter Stephenson wrote:

> Just trying compset -q to enhance completion for *sh -c:
> 
>   The word
>   currently being completed is split in separate words at the spaces. The 
>   resulting words are stored in the tt(words) array, and tt(PREFIX),
>   tt(SUFFIX), tt(QIPREFIX), and tt(QISUFFIX) are modified to reflect the 
>   word part that is completed.
> 
> What doesn't seem to get updated is CURRENT, which for consistency ought to
> point into the $words array as modified.

Whoa. Ahem.

This also corrects the test to decide if the ignored prefix/suffix
should be quoted or not.

Bye
 Sven

diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Fri Jul  9 15:48:20 1999
+++ Src/Zle/zle_tricky.c	Mon Jul 12 14:07:18 1999
@@ -5172,7 +5172,7 @@
 	compisuffix = ztrdup("");
 	zsfree(compqiprefix);
 	zsfree(compqisuffix);
-	if (instring) {
+	if (ois) {
 	    compqiprefix = qp;
 	    compqisuffix = qs;
 	} else {
@@ -5188,6 +5188,7 @@
 	    p = compwords[i] = (char *) getdata(n);
 	    untokenize(p);
 	}
+	compcurrent = cur + 1;
 	compwords[i] = NULL;
     }
     autoq = oaq;
diff -u od/Zsh/compwid.yo Doc/Zsh/compwid.yo
--- od/Zsh/compwid.yo	Mon Jul 12 10:21:21 1999
+++ Doc/Zsh/compwid.yo	Mon Jul 12 14:10:11 1999
@@ -622,9 +622,9 @@
 item(tt(-q))(
 The word
 currently being completed is split in separate words at the spaces. The 
-resulting words are stored in the tt(words) array, and tt(PREFIX),
-tt(SUFFIX), tt(QIPREFIX), and tt(QISUFFIX) are modified to reflect the 
-word part that is completed.
+resulting words are stored in the tt(words) array, and tt(CURRENT),
+tt(PREFIX), tt(SUFFIX), tt(QIPREFIX), and tt(QISUFFIX) are modified to
+reflect the word part that is completed.
 )
 enditem()
 

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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