-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
LSP-server slow autocomplete response jj
conflict
#11009
Comments
I don't know if I expressed myself clearly <script setup lang="ts">
import { ref, reactive } from 'vue'
const value = re
// ^ <-- Cursor is here
// ^ <-- Assuming that waiting for the lsp to return is too slow here and I want to enter it manually
// ^ <-- Trigger (jj)`jjkjjaxv` enter insert mode it won't work
</script> |
Thanks for the report, makes sense, and I will see if I can reproduce. |
@d1y I heard that this might be resolved. I think the likely problem (before) #12630 was that when the completion request returned we would change the keymap context; and when we change the context that invalidates any multi-key bindings. I'm going to close this, but please re-open if you can still reproduce. I am not sure why |
When I input quickly, there is still a problem. GIF: const x = falsejjkj
// Fast input `false` and `j j` And `k`
// There will be this problem Compared to VScode is silky and smooth 🤔 Screen.Recording.2024-06-11.at.03.28.05.mov👇🏻👇🏻👇🏻The following questions can actually be deleted! Solving the binding of menu 👇🏻👇🏻👇🏻 {
"context": "Editor && vim_mode == insert",
"bindings": {
"j j": "vim::NormalBefore"
}
}
[
{
"context": "Editor && vim_mode == insert && !menu",
"bindings": {
"j j": "vim::NormalBefore"
}
}
] Screen.Recording.2024-06-10.at.20.22.57.movI use zed-nightlyZed: v0.140.0 (Zed Nightly e829a8c) |
Simplify key dispatch code. Previously we would maintain a cache of key matchers for each context that would store the pending input. For the last while we've also stored the typed prefix on the window. This is redundant, we only need one copy, so now it's just stored on the window, which lets us avoid the boilerplate of keeping all the matchers in sync. This stops us from losing multikey bindings when the context on a node changes (#11009) (though we still interrupt multikey bindings if the focus changes). While in the code, I fixed up a few other things with multi-key bindings that were causing problems: Previously we assumed that all multi-key bindings took precedence over any single-key binding, now this is done such that if a user binds a single-key binding, it will take precedence over all system-defined multi-key bindings (irrespective of the depth in the context tree). This was a common cause of confusion for new users trying to bind to `cmd-k` or `ctrl-w` in vim mode (#13543). Previously after a pending multi-key keystroke failed to match, we would drop the prefix if it was an input event. Now we correctly replay it (#14725). Release Notes: - Fixed multi-key shortcuts not working across completion menu changes ([#11009](#11009)) - Fixed multi-key shortcuts discarding earlier input ([#14445](#14445)) - vim: Fixed `jk` binding preventing you from repeating `j` ([#14725](#14725)) - vim: Fixed `escape` in normal mode to also clear the selected register. - Fixed key maps so user-defined mappings take precedence over builtin multi-key mappings ([#13543](#13543)) - Fixed a bug where overridden shortcuts would still show in the Command Palette
Hi @ConradIrwin Screen.Recording.2024-07-23.at.02.59.11.mov |
@d1y I am struggling to reproduce this after #14942. Trying to look at this video, I am also a bit confused. It seems like your keyboard overlay is missing some keystrokes. Can you please let me know what you typed exactly to get For me on Zed Preview, I can reproduce a problem starting from: I then type On Zed Nightly, I cannot reproduce the bug with this technique. |
@ConradIrwin I'm sorry for bothering you
Screen.Recording.2024-07-23.at.06.27.34.mov |
Simplify key dispatch code. Previously we would maintain a cache of key matchers for each context that would store the pending input. For the last while we've also stored the typed prefix on the window. This is redundant, we only need one copy, so now it's just stored on the window, which lets us avoid the boilerplate of keeping all the matchers in sync. This stops us from losing multikey bindings when the context on a node changes (zed-industries#11009) (though we still interrupt multikey bindings if the focus changes). While in the code, I fixed up a few other things with multi-key bindings that were causing problems: Previously we assumed that all multi-key bindings took precedence over any single-key binding, now this is done such that if a user binds a single-key binding, it will take precedence over all system-defined multi-key bindings (irrespective of the depth in the context tree). This was a common cause of confusion for new users trying to bind to `cmd-k` or `ctrl-w` in vim mode (zed-industries#13543). Previously after a pending multi-key keystroke failed to match, we would drop the prefix if it was an input event. Now we correctly replay it (zed-industries#14725). Release Notes: - Fixed multi-key shortcuts not working across completion menu changes ([zed-industries#11009](zed-industries#11009)) - Fixed multi-key shortcuts discarding earlier input ([zed-industries#14445](zed-industries#14445)) - vim: Fixed `jk` binding preventing you from repeating `j` ([zed-industries#14725](zed-industries#14725)) - vim: Fixed `escape` in normal mode to also clear the selected register. - Fixed key maps so user-defined mappings take precedence over builtin multi-key mappings ([zed-industries#13543](zed-industries#13543)) - Fixed a bug where overridden shortcuts would still show in the Command Palette
Check for existing issues
Describe the bug / provide steps to reproduce it
My custom keymap
When the return is slow, triggering jj will conflict and will be directly input into the buffer. (like
jjkjkjjkkjxdfjk
)/cc @mrnugget @ConradIrwin
Screen.Recording.2024-04-26.at.03.10.02.mov
The VScode faster 👀, and no incorrect inference prompts in
{}
Screen.Recording.2024-04-26.at.03.18.41.mov
Environment
Zed: v0.133.2 (Zed Preview)
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
The text was updated successfully, but these errors were encountered: