Closed gregorypease280 closed 1 week ago
It is hard for me to tell as well. We have a bit of work to do on our keymap system - it could use some polish. I think this is some limitation with the system at the moment.
Thanks for taking a look! My hunch is that a no-op bind might be the quickest fix for cases like these.
I thought that zed::NoAction
might be what was needed here, but it does actually no-op it rather than just passing through the underlying key. What I'm hoping to achieve here is to be able to, for example, unbind enter
from triggering editor::ConfirmCompletion
, so that instead of doing nothing when I hit enter, it inserts a newline.
Not sure if it makes sense in the model that Zed is going for, but what I think would solve my problem here is the ability to map enter
to a sequence of commands like ["editor::Cancel", ["editor::SendKeystroke", "enter"]]
, similar to how we can already send keystrokes to the terminal.
So, currently there still is no command to to cycle through auto-complete options?
There are now keys/actions in the default keymap that support this. Docs: Using Inline Completions
If you don't want tab
to do this you'll have to unnbind the default:
https://github.com/zed-industries/zed/blob/5586397f952bdf34590b2d1a1097071dbd987a7d/assets/keymaps/default-macos.json#L480-L485
With something like:
{
"context": "Editor && inline_completion && !showing_completions",
"bindings": {
"tab": "editor::Tab",
}
},
Happy to reopen if that doesn't solve your issue, just leave a comment. Thanks.
Check for existing issues
Describe the bug / provide steps to reproduce it
I can't tell if this just isn't supported or a bug. I'm trying to make it so tab will cycle through auto complete options instead of selecting one. Is there a way to even unbind a key completely? Perhaps it's because menu::SelectNext is not valid in this context.
I also don't believe there are any errors being reported if keymap.json is invalid in any way?
my keymap.json
Environment
Zed: v0.85.3 (stable) OS: macOS 13.3.1 Memory: 16 GiB Architecture: x86_64
If applicable, add mockups / screenshots to help explain present your vision of the feature
ideally I think the keymap should look somethign like this. `[
] `
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