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

Re: Bug#519535: history expansion: modifier completion missing



2009/3/16 Peter Stephenson <pws@xxxxxxx>:
> On Sun, 15 Mar 2009 06:22:53 +0000
> Clint Adams <schizo@xxxxxxxxxx> wrote:
>> On Fri, Mar 13, 2009 at 11:55:55AM +0100, martin f krafft wrote:
>> > I tried to show off zsh to a sceptic today and had to find out the
>> > hard way that it does not (yet) provide completion for history
>> > expansion modifiers, e.g.
>> >
>> >   echo !$:<TAB>
>
> I thought this was going to be harder than it turned out to be; as you can
> see it's really quite simple, particularly since I already wrote modifer
> completion and it would appear had the foresight to make it handle the
> history case.
>
> It's in _normal which is where we handle normal command arguments.  I think
> this is both the first and last place where get to massage command line
> arguments generically---we don't just want this in default completion since
> history expansion, if active, trumps everything else.
[...]
> So it seems to work fine (possibly depending on your options and
> completers---there are other things around that will do other things to
> !'s), but I'm still a bit confused.

Is it supposed to work here? $PWD:<tab> (it doesn't for me). It does
complete if you write $PWD(:<tab>, but also in ${PWD(:<tab>, but
accepting one of the latter produces a syntax error:
% echo ${PWD(:A)}
zsh: bad substitution
(regardless of which modifier you use)

Also, i get this:
$PWD(:s-<tab>
_history_modifiers:34: bad math expression: operand expected at `^-'
_history_modifiers:34: bad math expression: operand expected at `^-'
_history_modifiers:34: bad math expression: operand expected at `^-'
_history_modifiers:34: bad math expression: operand expected at `^-'
_history_modifiers:34: bad math expression: operand expected at `^-'
_history_modifiers:34: bad math expression: operand expected at `^-'
(same with / or other separator (but it says `^/' then, of course))

As an aside, after i write $PWD(:<tab> to get the s, how do i "accept"
the completion to make tab complete the - instead of cycling to the
next completer? The only way i found is typing something and deleting
it... When completing directories i usually just type a /.

-- 
Mikael Magnusson



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