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

zle: vi mode: wrong undo handling on fresh lines



Insert operations should count as a single step in the undo history,
i.e. from command mode

    ifoo<ESC>u

should effectively be a no-op.

AFAICT, zsh handles this fine with the exception of fresh lines. For
example, typing

    foo<ESC>u

yields "fo" instead of the expected empty line. Expliduntantly setting

    function zle-line-init { zle vi-insert; }; zle -N zle-line-init

works around this misbehavior (and I ran with it for a while) but
leads to undesired behavior in places that I can't quite remember now.
As an aside, `zle -K viins' does not have the same effect as `zle
vi-insert' here, when I expected them to be functionally equivalent.

This is on 5.0.2 but has been the case for as long as I can remember.
I thought I had posted this to the ML before but apparently have not.



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