[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: yank-last-arg with numeric argument doesn't work as intended in vi m

From: Chet Ramey
Subject: Re: yank-last-arg with numeric argument doesn't work as intended in vi mode
Date: Mon, 8 Jun 2020 15:09:06 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

On 6/8/20 12:46 AM, Leo Alekseyev wrote:
> With GNU readline 7.0 / bash 4.4.20(1) it appears to be impossible to
> insert nth argument of a previous command in vi mode.
> According to the manual, setting a numeric argument (e.g. Alt-1) and
> repeatedly invoking Alt-. should keep inserting nth argument from
> preceding commands. For example, issuing
> echo arg1 arg2
> echo argA argB
> and pressing Alt-1 Alt-. Alt-. inserts arg1 (first inserting argA,
> then replacing with arg1).
> However, the same sequence of operations fails in vi mode even when
> the keys are bound appropriately. In particular, pressing Alt-1 Alt-.
> Alt-. inserts argA arg2.
> Subsequent invocation of Alt-. replace arg2 with the 2nd argument of
> the preceding command, i.e. readline is now behaving as if the numeric
> argument were 2.
> This certainly seems like buggy/out-of-spec behavior, is there a known
> workaround?

The common backend for yanking the last argument implements the vi-mode
standard behavior for the `_' command, which is what you observe. I'll see
if I can disentangle it.


``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]