Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completeinword and ambiguous completions
- X-seq: zsh-workers 8351
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Completeinword and ambiguous completions
- Date: Thu, 21 Oct 1999 09:10:32 +0200 (MET DST)
- In-reply-to: "Bart Schaefer"'s message of Wed, 20 Oct 1999 18:01:15 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Bart Schaefer wrote:
> Consider the following situation:
>
> zsh% setopt completeinword
> zsh% setopt pro<TAB>
> zsh% setopt prompt<TAB>
> promptbang promptcr promptpercent promptsubst promptvars
>
> Note that the prefix "prompt" is unambiguous. Now consider what happens
> if the cursor is over the "m" when TAB is hit in each of these cases:
>
> zsh% setopt prompt
> (feep, cursor stays on "m")
> zsh% setopt promptvars
> zsh% setopt promptvars
> (cursor is one space past end of word)
>
> What I'd like is, in the first of those cases, the cursor doesn't stay
> on the "m" but rather moves to the end of the unambiguous prefix, so that
> I can immediately start menu completion for the rest of the word. The
> following almost does it:
That's a case for global match specs, since what you want is that the
code finds out that you are in a prefix for possible matches and moves
you at the end of the unambiguous string. Since completeinword
normally doesn't test this, but instead looks only for strings ending
with the stuff after the cursor, it doesn't help. But with:
compmatchers=('r:|=*')
It takes the string from the line only as a prefix, builds the
possible matches you were expecting and puts you at the place were
something is missing, i.e. the end in your example.
This is then independent of the setting of completeinword (at least in
this example). And, of course, you may prefer to use:
compmatchers=('' 'r:|=*')
to first try to generate matches without this strings-is-a-prefix
behaviour.
Is that good enough?
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author