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

Re: PATCH: expand-or-complete-prefix



On Feb 21, 11:00am, Peter Stephenson wrote:
} Subject: Re: PATCH: expand-or-complete-prefix
}
} "Bart Schaefer" wrote:
} > I've just been testing this, and it breaks on menu completion:
} > 
} > zagzig% bindkey '\t' expand-or-complete-prefix 
} > zagzig% setopt menucomplete 
} > zagzig% ls zlc
} >              ^ with cursor here, press TAB, and you get
} > zagzig% ls zle_bindings.oc
} >                          ^ press TAB again
} > zagzig% ls zle_hist.oc
} >                      ^ press TAB again
} > zagzig% ls zle_hist.proc
} >                        ^ and so forth
} 
} Is that really a bug?  The prefix is 'zl', and that's what you're
} completing

Oh, of course; silly me.  I was misled by (with-out- menucomplete):

zagzig% ls zlc
             ^ with cursor here, press TAB, and you get
zagzig% ls zle_c
               ^ press h then TAB again
zagzig% ls zle_hist.c

But the reason it stopped there is because "zle_hist." is an ambiguous
completion (a prefix of both zle_hist.o and zle_hist.pro), not because
it matched the file zle_hist.c, which is what I thought caused it to
stop.

So you're right, there's no bug there.

Although I do notice one thing:

zagzig% zlc
          ^ with cursor here, press TAB, and I get
zagzig% zless c
             ^ note space before cursor

But in this case:

zagzig% zc
zagzig% zcatc
            ^ note no space
zagzig% zdumpc
zagzig% zlessc

I realize that's an artifact of the way a unique completion works, so I'm
not prepared to suggest changing it yet, but it's not like e.g. bash:

zagzig% bash -f
[schaefer@zagzig zsh-3.0.5-build]$ zlc
                                     ^
[schaefer@zagzig zsh-3.0.5-build]$ zlessc
                                        ^
[schaefer@zagzig zsh-3.0.5-build]$ zl
                                     ^
[schaefer@zagzig zsh-3.0.5-build]$ zless 
                                         ^
                                     Space inserted only if at end of line

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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