[Top][All Lists]

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

Re: [Bug-readline] vi-mode: fix relationship of `.' to f/F/t/T

From: Chet Ramey
Subject: Re: [Bug-readline] vi-mode: fix relationship of `.' to f/F/t/T
Date: Mon, 1 Oct 2018 09:38:57 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 9/29/18 8:09 PM, Richard Todd wrote:
> Hi all,
> I believe this is a vi-mode POSIX issue, this time:
> Let's take the following line:
>     'ball' 'animal' 'angle'
> With the cursor at the front, in vim's compatibility mode, I can issue the
> following commands (with spaces added only for clarity here):
>     fb dt' fa . ; . 
> ... and I will be left with three sets of quotes:
>     '' '' ''
> This sequence illustrates two features not present in readline's vi-mode:

This is another excellent candidate for an extended vi editing mode. These
features are not present in the description of the shell's command line

>   1) Since the `fa' command will overwrite _rl_vi_last_search_char, the 
> following `.'
>      command doesn't remember it should delete up to a single-quote.
>      The POSIX section for "[count] ."  states: "Repeated commands with 
> associated
>      motion commands shall repeat the motion command as well".  The dot should
>      repeat dt' regardless of any intervening t/T/f/F commands.

The shell command line editing description says only:

"Repeat the most recent non-motion command, even if it was executed on an
earlier command line."

The rest of the description concerns how the command treats [count].

>   2) Since the `.' command overwrites _rl_cs_dir to FTO, the next `;' command
>      has forgotten that it is repeating a FFIND command (fa).
>      The POSIX section for "[count] ."  states: "If the motion component of 
> the
>      repeated command is f, F, t, or T, the repeated command shall not set the
>      remembered search character for the ; and , commands."

The shell description says:

"Repeat the most recent f, F, t, or T command."

with no mention of the remembered search character.

> (I'm using http://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html 
> as
> my reference)

I use the shell command line editing description in


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

reply via email to

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