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

Re: Vimode problem (key press dropping)



"Jun T." wrote:
> 
> On 2015/07/29, at 18:26, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> > 
> > Question to -workers subscribers: how should we address this in the
> > defaults?
> 
> In zle_keymap.c, near line 1493, timeout is set only if
> (f != t_undefinedkey). But ESC is an undefinedkey in vicmd keymap,
> and the timeout remains to be zero even if ispfx is true.

I don't think this helps because where the prefix is an individual key
typed by the user, they are then forced to type the following character
in the sequence faster than KEYTIMEOUT. And if something like <Escape>a
is typed too fast from vi-mode, it would still be thrown out as a whole.
Taking the default emacs bindings, Ctrl-X is a prefix but we don't
want a timeout after Ctrl-X because it is the user typing followup
characters.

Mikael wrote:
> I always felt like how it should work if we get the string "abc", is
> first abc is looked up and we find it isn't bound to anything, the a
> gets treated as a separate input string, then we look up bc instead,
> etc. What we do now is just discard the whole string as
> "undefined-key".

The current behaviour where the whole sequence is thrown out is
consistent with emacs. I think it makes sense for the typical emacs case
if you make a mistake with a manual sequence. We can't really
special-case escape because manual sequences with escape are also common
in emacs mode. Binding escape in vi command mode does, however, solve
it.

Oliver



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