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

all-matches with a suffix



martin.ebourne@xxxxxxxxxxxx wrote:

> ...
> 
> I've tracked it down to the -r (or -q) option to compadd. The completions
> are added as:
> 
>     compadd -S ", " -r ", \t\n\-" -a _sql_columns
> 
> This is so that when you complete a column name normally in the select list
> it appends a comma and a space, but if you type comma or space it removes
> it again.
> 
> If I remove the -r then I get the much better:
> 
>     select environ,  gid,  name,  suid,  uid,  from sysusers
> 
> Presumably if the -r was in still, then typing space would remove that last
> comma?
> 
> Any idea what's up?

Yes ;-)

The problem here is that it has to cheat if you want to call it that.
There is this pseudo match I've been talking about already, containing
all the other matches.  In order to insert that match, it inserts the
other matches one by one, as if one were in a menu completion and
repeatedly using accept-and-menu-complete, typing spaces between the
matches.  Now the `-r' option means that the suffix (-S ', ') should
be removed if the next character typed is a space (or a comma, or...).

So.

So what do we do now?

That auto-remove thing is certainly the right thing when used
interactively, but for this all-matches thing...

Hm, we had some discussion about all this suffix handling anyway, so
maybe we should start collection other problems people see or have
seen with it and then find the real solution.  At least I can't see
any simple solution now, without adding another option to compadd,
telling it how it should behave for a-a-m-c.  and that would look like 
a hack, somehow.


Bye
  Sven

-- 
Sven Wischnowsky                    wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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