jeffreytse / zsh-vi-mode

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

Different results when typing cw depending on interval between keypresses #48

Closed gotgenes closed 3 years ago

gotgenes commented 3 years ago

I'm observing an one extra word deleted when using cw (or [count]cw or c[count]w) if typing the sequence of keys rapidly.

For the line

echo 1 2 3 4 5

Enter normal mode and place the mouse over 1.

If the user types c, waits a half a second, then types w, it will delete 1 and place the cursor after where the 1 was

echo | 2 3 4 5

This is the expected behavior.

If, however, the user quickly types cw, it will delete 1 2 and place the cursor after where the 2 was

echo | 3 4 5

That is, an additional word will get deleted.

This behavior is consistent for whatever [count] is provided, too. For example, for 2cw typed quickly, it will instead delete three words 1 2 3 instead of 1 2.

jeffreytse commented 3 years ago

Hi @gotgenes

Thanks for your reporting and patience, now this issue has been addressed and fixed, please update your plugin to the latest version.

Thanks and regards

gotgenes commented 3 years ago

No worries! Fix confirmed in latest version. Thanks for taking the time to fix this!