zed icon indicating copy to clipboard operation
zed copied to clipboard

AI panel shows multiple times when `cmd+i` is pressed

Open maxvdec opened this issue 8 months ago • 1 comments

Summary

When you are editing and press cmd-i in a fresh installation, then the AI panel pops up. But, if you keep pressing the keystroke, then it creates more instances of the panel stacked up instead of just dismissing the action.

For the record. Running Zed: 0.179.5

Image

Steps to see the problem.

  1. Go into a file
  2. Press Cmd+I a bunch of times

Expected Behavior: Would be nice if instead of creating MORE panels the keystroke would just dismiss the panel.

This also leads to weird cursor errors:

Image

Zed Version and System Specs

Zed: v0.179.5 (Zed) OS: macOS 15.3.2 Memory: 24 GiB Architecture: aarch64

maxvdec avatar Apr 02 '25 05:04 maxvdec

The default bind of cmd-i is: https://github.com/zed-industries/zed/blob/632f08d2a3b708c6baa8aa6b1bf53c482c3c3a6a/assets/keymaps/default-macos.json#L153 Which makes a textDocument/signatureHelp request to the LSP.

I assume you've rebound cmd-i to `"ctrl-enter": "assistant::InlineAssist" with:

  {
    "context": "Editor",
    "bindings": {
      "cmd-i": "assistant::InlineAssist"
    }
  },

I can reproduce you issue with the above keymapping. Please make sure to explicitly include such details in the future, you have a user config which is triggering this issue (this is not the default, and the default ctrl-enter does not exhibit this behavior).

If you use this instead, repeated presses of cmd-i will not trigger additional prompts:

  {
    "context": "Editor && mode == full",
    "bindings": {
      "cmd-i": "assistant::InlineAssist"
    }
  },

I couldn't figure out how to get cmd-i to be a toggle, the nested context where an Editor inherits from is a funky cornercase that we don't handle well.

Image

Thanks for reporting.

notpeter avatar Apr 30 '25 18:04 notpeter

This was fixed. Thanks for reporting.

notpeter avatar May 29 '25 14:05 notpeter