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

[vim mode] when using find (f) to look for the letter "g", there is a delay where the editor is waiting for more input #12483

Closed
1 task done
tmke8 opened this issue May 30, 2024 · 5 comments · Fixed by #12552
Labels
defect [core label] vim

Comments

@tmke8
Copy link

tmke8 commented May 30, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

  1. Use default vim keymap
  2. Put your cursor into a line containing a "g", and put the cursor to the left of it
  3. press fg

Expectation: the cursor jumps to the "g". Reality: there is a delay before anything happens.

I suspect the reason for this behavior is that there are a lot of keybindings starting with "g" and so the editor is waiting whether you want to use any of them. The solution is perhaps to create a new "g mode", just like the "c mode" and the "d mode"?

Environment

Zed: v0.137.3 (Zed)
OS: macOS 14.4.1
Memory: 16 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

@tmke8 tmke8 added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels May 30, 2024
@canadaduane
Copy link

Confirmed that this happens only for "fg" and not, say, "fa" or "fb".

@Innominus
Copy link

similar issue with ctrl + w in vim mode to close the window. There's a large delay before it closes your active window

@JosephTLyons JosephTLyons added vim and removed triage Maintainer needs to classify the issue admin read Pending admin review labels May 31, 2024
@xzbdmw
Copy link
Contributor

xzbdmw commented Jun 1, 2024

@Innominus you can check similar condition like my pr

@tmke8
Copy link
Author

tmke8 commented Jun 1, 2024

I think the Ctrl+w issue can't really be solved as long as you have any normal-mode two-part mappings where the first part is Ctrl+w (and there are many such mappings). Because zed will always have to wait whether there's a second key. The fg issue is different because there can only be one key after f so there shouldn't be any reason to wait.

@xzbdmw
Copy link
Contributor

xzbdmw commented Jun 1, 2024

I think the Ctrl+w issue can't really be solved as long as you have any normal-mode two-part mappings where the first part is Ctrl+w (and there are many such mappings). Because zed will always have to wait whether there's a second key. The fg issue is different because there can only be one key after f so there shouldn't be any reason to wait.

Yes c-w is kinda special in vim, I usually use q to quit window and Q to macro

mrnugget pushed a commit that referenced this issue Jun 3, 2024
Release Notes:
-Fixed #12483 
It turns out to be very simple. `fg` has conflict with `gc` mapping so
when you type g editor state is pending.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] vim
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants