zed
zed copied to clipboard
Vim mode: using "space" as a leader key sometimes doesn't activate
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
From time to time, if a custom keybinding uses space as a "leader key", the default behaviour will still occur, meaning that the custom keybinding will not fire correctly. For example, if the binding is "space o t" in order to focus the terminal panel, sometimes the default binding for space (which moves the cursor to the right by one character) is triggered, meaning that the other keys pressed (o and t) are fired as normal, which will create a new line and insert the letter t.
Environment
Zed: v0.121.1 (Zed Preview) OS: macOS 14.0.0 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.
If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.
No response
We do have a timeout of 1sec in which you need to hit the following keys. Do you think you might run into this? Or do you have any other steps to reproduce?
That's the thing, there is no 1sec timeout because it immediately just uses the default binding. I'll get a quick screencap of this.
https://github.com/zed-industries/zed/assets/14109339/355f9373-bbe1-43ad-918a-3b4753165c78
Here I'm using the "space o t" keybind I referred to in my original comment.
For me it seems to works perfectly on that pre-release: https://github.com/zed-industries/zed/releases/tag/v0.121.1-pre
Here is an example of my keymap: (I even test it too with space o t and it was working fine for me)
[
{
"context": "Editor && vim_mode == normal && vim_operator == none && !VimWaiting",
"bindings": {
"space e": "workspace::ToggleLeftDock",
"space t": "workspace::ToggleBottomDock",
"space /": [
"editor::ToggleComments",
{
"advance_downwards": false
}
]
}
},
{
"context": "ProjectPanel",
"bindings": {
"escape": "workspace::ToggleLeftDock"
}
},
{
"context": "Terminal",
"bindings": {
"cmd-n": "workspace::NewTerminal",
"cmd-d": "pane::CloseActiveItem",
"cmd-t": "workspace::ToggleBottomDock",
"cmd-shift-f": "workspace::ToggleZoom",
"escape": "workspace::ToggleBottomDock"
}
}
]
Edit: It may always works for me because I always close my Panel/Terminal with escape to return the focus on my editor?
Not quite sure then, bare in mind this isn't just an issue with the space o t keybind, for me this is happening regardless of the letters after space is hit.
Apologies, thought this was fixed after a reboot, but no such luck.