jeffreytse / zsh-vi-mode

💻 A better and friendly vi(vim) mode plugin for ZSH.
MIT License
2.99k stars 103 forks source link

Bug - canceling `d` or `c` with `escape` still performs an action #182

Closed PowerUser64 closed 1 year ago

PowerUser64 commented 2 years ago

General information

Basic examination


note: when I say "action," I mean command. I'm just saying action to disambiguate between editor commands (hjkl) and terminal commands (rm -rf).

Problem description

zvm doesn't respect pressing escape to cancel actions that require a motion, such as d or c. Instead, zvm performs the action on the single character under the cursor.

It's possible this happens with other actions too, but d and c are the only ones I have noticed it with.

Reproduction steps

  1. Type something in insert mode into the prompt (ex: echo)
  2. Press escape to enter normal mode
  3. Type c
  4. Cancel the action by pressing escape

Notice how the character under your cursor is gone, and you have been put in insert mode. This happens with d as well, except it doesn't put you in insert mode.

Expected behavior

Pressing escape after typing an action that requires a motion should cancel the action and not change modes.

\ Thanks for the great software!

PowerUser64 commented 1 year ago

Seems this has been fixed in a recent release