On 4/4/23 3:18 AM, Emanuele Torre wrote:

Bash Version: 5.2
Patch Level: 15
Release Status: maint


When the prompt contains    abcjefgjjhij123  , and the cursor is before
the third j, and i press dtj, nothing will be deleted.

Thanks for the report. I assume you mean the second j, since the examples
below show that.


     (^ cursor)

     abcjefg^jjhij123
         dtj
     abcjefg^jjhij123
         dtj
     abcjefg^jjhij123

The correct vi behaviour would be to delete the j after the cursor:

I forgot how many special cases you have to account for in vi. In this one,
the motion command (`tj') doesn't move the cursor at all, so it's a no-op
when issued individually, but when issued as a motion command with commands
like `c' or `d', it has to consume at least one character. There was
already a special case in there for c/C, so it looks like d/D will need one
as well, and probably y/Y.

Chet

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


Reply via email to