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

CMD + Right is triggering something. AI Autocomplete? Not "end of line" in any case #19355

Closed
1 task done
a-non-a-mouse opened this issue Oct 17, 2024 · 4 comments
Closed
1 task done
Labels
keymap / key binding Feedback for keyboard shortcuts, key mapping, etc support User support (non-defect troubleshooting, documentation, etc)

Comments

@a-non-a-mouse
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

CMD+Right is sometimes triggering something that is not "end of line" (which is the only keybinding listed for it on your keybindings page). I think it's AI autocomplete, but I'm not quite sure.

If there's a way to figure out what's being executed, let me know.

Environment

Zed: v0.157.5 (Zed)
OS: macOS 15.0.0
Memory: 16 GiB
Architecture: aarch64

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

zed-bug.mov

If applicable, attach your Zed.log file to this issue.

Zed.log
@a-non-a-mouse a-non-a-mouse added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Oct 17, 2024
@notpeter
Copy link
Member

notpeter commented Oct 17, 2024

{
"context": "Editor && mode == full && inline_completion",
"bindings": {
"alt-]": "editor::NextInlineCompletion",
"alt-[": "editor::PreviousInlineCompletion",
"cmd-right": "editor::AcceptPartialInlineCompletion"
}
},

If you don't want this you can unbind it by adding this in your keymap.json:

[
  {
    "context": "Editor && mode == full && inline_completion",
    "bindings": {
      "cmd-right": null
    }
  }
]

@notpeter notpeter added keymap / key binding Feedback for keyboard shortcuts, key mapping, etc support User support (non-defect troubleshooting, documentation, etc) and removed bug [core label] triage Maintainer needs to classify the issue admin read Pending admin review labels Oct 17, 2024
@a-non-a-mouse
Copy link
Author

a-non-a-mouse commented Oct 18, 2024

Thanks, but there are a few of other issues here

  • in my video, you can see that there is no suggested completion, so you're often blind to what's actually going to happen with the default bindings
  • I would STRONGLY argue that you should not ever overload something as fundamental as "end of line" and that the default binding should be changed.
  • This isn't documented. According to https://zed.dev/docs/key-bindings, the only keybinding for ⌘ + Right is EOL

@notpeter
Copy link
Member

This isn't documented. According to https://zed.dev/docs/key-bindings, the only keybinding for ⌘ + Right is EOL

  • For the moment, I recommend you reference default-macos.json as the source of truth for key bindings. You can also access this in-app via the zed: open default keymap from the command palette.

  • There has been some work to generate our settings documentation from the source of truth in-repo, with the thought that we could do the same for keymaps, but that has been put on hold: docs: Generate setting docs from JSON schema #16554

  • We are aware that the docs at https://zed.dev/docs/key-bindings are out of date, these docs are currently manually maintained and thus chronically out of date. Beyond this missing key, you will also notice it also Linux keymaps are entirely absent. Happy to review PRs.

I would STRONGLY argue that you should not ever overload something as fundamental as "end of line" and that the default binding should be changed.


This is the thing with keybindings, there is no magical one size fits all solution which makes everyone happy -- and this is why we support custom keymaps.

@a-non-a-mouse
Copy link
Author

You're apparently right, but also I've never once seen that in VSCode until I just went looking for it. I couldn't even figure out how to trigger it without going to SO, lol. There's apparently multiple different types of inline completions. Anyway, there are a couple of key differences (2nd one is probably a bug):

  • VSCode's inline suggestions of that exact fashion are opt-in, they're not default behavior (even with co-pilot and inline suggestions, they're in a different context, but I can't figure out how to inspect it because opening the inspector makes the context dissapear)
  • Zed doesn't always show inline completions (even after waiting), yet CMD+right still triggers them. So it is impossible to know what cmd+right is going to do

The net result here is that in years I've never once noticed VSCode do anything to my navigation keys other than sometimes block them if a popup is open.

With Zed, I'm constantly undoing stuff that it inserted/replaced/deleted.

I hope that doesn't sound too harsh :) You guys have done some great work, this bit just needs some attention IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keymap / key binding Feedback for keyboard shortcuts, key mapping, etc support User support (non-defect troubleshooting, documentation, etc)
Projects
None yet
Development

No branches or pull requests

2 participants