On 11/4/16 6:36 AM, Clark Wang wrote:
> For example, in vi-insert mode I input following in the command line:
> 
> # foo abc
> 
> The cursor is right after 'c'. Now if I press ESC then it'll go to
> vi-command mode and the cursor will move to under 'c'. But if I press jj
> the cursor would be still after 'c' and if then I press h the cursor will
> skip 'c' and move to under 'b' . In 4.3, ESC and jj works the same so there
> must be something changed in 4.4. Please take a look.

What changed is not really what you would think.  The key sequence you
have typed results in ESC, which is ambiguous: it's both a key binding
and a key prefix.  Readline is waiting until you type an additional
character to resolve the ambiguity.  For instance, if you were to type
`0' after this, readline would move the cursor to column 0 in vi
command mode.

There is special code in readline that uses a timeout to disambiguate for
the special case of ESC typed in vi insert mode.  I will have to look
and see whether or not it makes sense to use that same timeout code for
a keyboard macro that resolves to ESC.

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://cnswww.cns.cwru.edu/~chet/

Reply via email to