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

Re: Still something strange with ambiguous prefix



I wrote:

> Andrej Borsenkow wrote:
> > 
> > bor@itsrm2:~%> l /t/s/gl/co*TAB
> > bor@itsrm2:~%> l /tools/src/glib-1.1.15/co* <= cursor here
> > glib-1.1.15/  glib-1.2.0/
> > 
> > So, menu completion is started for prefix, but cursor is placed at the end
> > of word.
>
> Anyway, I don't know how I should change this easily for now. The
> problem is that the path suffix is just an ignored suffix for the
> completion code and normally one really wants to have the cursor at
> the end of the whole word with menu-completion.
> We could add a flag stored with each match and add an option for
> `compadd' to turn this on which would make the cursor be left before
> that suffix.
> But I'd really like to hear at least one comment from someone else
> using menucompletion before doing this (hm, although, maybe if we add
> another configuration key..., yes maybe I'll produce a patch for this
> sometime).

I should have thought about ALWAYS_TO_END. Without the patch below it
doesn't do what Andrej requested, but maybe it should be made to do
that.
Previously it left the cursor in the word only if completion was
started with the cursor in the word.

Dunno if this is the right thing to do and I don't want to decide it.

Bye
 Sven

diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Thu Mar 25 18:08:58 1999
+++ Src/Zle/zle_tricky.c	Fri Mar 26 09:08:20 1999
@@ -6721,7 +6721,8 @@
 	/* We are currently not in a menu-completion, *
 	 * so set the position variables.             */
 	menupos = wb;
-	menuwe = (cs == we) || isset(ALWAYSTOEND);
+	/* previously:	menuwe = (cs == we) || isset(ALWAYSTOEND); */
+	menuwe = isset(ALWAYSTOEND);
 	menuend = we;
     }
     /* If we are already in a menu-completion or if we have done a *

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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