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

Slow on 'J' in NORMAL mode #240

Open
3 tasks done
piejanssens opened this issue Aug 30, 2023 · 1 comment
Open
3 tasks done

Slow on 'J' in NORMAL mode #240

piejanssens opened this issue Aug 30, 2023 · 1 comment
Assignees
Labels
good first issue Good for newcomers

Comments

@piejanssens
Copy link

General information

  • Terminal program: iTerm.app 3.4.20 (xterm-256color)
  • Operating system: macOS 13.5.1 (22G90)
  • ZSH framework: starship 1.16.0
  • ZSH version: zsh 5.9 (x86_64-apple-darwin22.0)
  • ZVM version: zsh-vi-mode 0.10.0

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

Using ZVM_VI_ESCAPE_BINDKEY=jj

Reproduction steps

  1. Press 'jj' to enter NORMAL mode
  2. Press 'k' a number of times to navigate back/up in the history
  3. Press 'j' to navigate down/forward in the history and notice a delay

Expected behavior

'j' should be as fast as 'k'
It seems that in NORMAL mode there is a delay after pressing 'j' perhaps because it's waiting if 'j' is pressed again within a certain timeframe (ZVM_VI_ESCAPE_BINDKEY). I would think that this is only necessary in INSERT mode to escape it.

@jeffreytse jeffreytse self-assigned this Sep 15, 2023
@jeffreytse
Copy link
Owner

Hi @piejanssens

Thanks for your issue. When you change the escape bindkey of normal mode to jj, it will make a common prefix of j, for j and jj, that's why the readkey engine needs to wait for a specific time ZVM_ESCAPE_TIMEOUT which is 0.3 seconds by default to accept next keystroke, by this way, it can confirm which function the user actually wants.

Thanks & Regards

@jeffreytse jeffreytse added the good first issue Good for newcomers label Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants