Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Escape Behavior in ZVM Visual Mode #257

Open
3 tasks done
tummetott opened this issue Dec 13, 2023 · 4 comments
Open
3 tasks done

Inconsistent Escape Behavior in ZVM Visual Mode #257

tummetott opened this issue Dec 13, 2023 · 4 comments

Comments

@tummetott
Copy link

General information

Basic examination

  • I have read through the README page
  • I have the latest version of zsh-vi-mode
  • I have tested with another terminal program

Problem description

Hello,
I've encountered a recurrent issue in ZVM where unintentional entry into visual mode leads to a challenging exit process. Often, by habit, I press i aiming to switch to insert mode, but this action instead initiates the operator pending mode within visual mode. This is an expected behavior of the mode. However, the problem arises when attempting to exit from this state. Repeatedly pressing ESC does not lead to an exit from the operator pending mode. It necessitates an additional action, the w key to select a word, before ESC successfully exits visual mode.

Reproduction steps

  1. Enter normal mode: Press ESC
  2. Switch to visual mode: Press v
  3. Activate operator pending mode: Press i or a
  4. Attempt to exit operator pending mode: Press ESC

Expected behavior

Upon completion of Step 4, the expectation is to exit operator pending mode directly with the ESC key.

@94kai
Copy link

94kai commented Apr 13, 2024

i have the same problem

@johnpyp
Copy link

johnpyp commented Apr 30, 2024

I've had the same issue for months at this point, only just realized it was caused by this specific behavior.

johnpyp added a commit to johnpyp/zsh-vi-mode that referenced this issue May 1, 2024
@tummetott
Copy link
Author

tummetott commented May 1, 2024

@johnpyp Well you found the right lines of code but uncommenting it is no solution. It is valid vim behavior to enter operator pending mode pressing v -> a or i. The problem is that ZVM does not exit this mode when pressing ESC in this state.

@johnpyp
Copy link

johnpyp commented May 1, 2024

Yeah, I just did that as a temporary patch. I tried to debug the issue but couldn't track down where the escape handling should actually happen... not familiar enough with the code / complex zsh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants