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

ctrl+click on a symbol should not open references if ctrl is pressed immediately after clicking #24019

Open
Ammaraly opened this issue Jan 31, 2025 · 6 comments
Labels
awaiting info Issue that needs more information from the user keymap / key binding Feedback for keyboard shortcuts, key mapping, etc mouse interaction Feedback for mouse interaction states, actions, etc

Comments

@Ammaraly
Copy link

Summary

When clicking on any symbol (variable, function name etc) and immediately pressing ctrl afterwards, zed opens the references for the symbol. This is very annoying behavior because usually it should only occur if ctrl is already pressed when the click happens.

It is annoying because usually you click on a symbol to copy it, or paste something in between for renaming, but it immediately jumps to the references tab instead.

Steps to trigger the problem:

  1. Open any code file (tested on .ts, .tsx, js, jsx)
  2. Click on any variable name, function or any object property
  3. Immediately press ctrl after the click

Actual Behavior: Zed opens the references tab for the symbol

Expected Behavior: Zed should not open the references tab for the symbol

Zed Version and System Specs

Zed: v0.172.2 (Zed Preview)
OS: Linux Wayland ubuntu 24.04
Memory: 27.2 GiB
Architecture: x86_64
GPU: AMD Radeon Graphics (RADV GFX1103_R1) || radv || Mesa 24.0.9-0ubuntu0.3

@probably-neb
Copy link
Contributor

Hey thanks for reporting this. I'm having trouble reproducing this behavior on Arch with X11 when I am not actively holding down ctrl while clicking. Maybe I'm just not as fast as you and it's an issue with Zed, or maybe it's an issue with input timings on Wayland or even a bit of both!
Would you mind trying to click then hit ctrl in some other non-Zed applications and see if the issue happens with them as well?

@probably-neb probably-neb added the awaiting info Issue that needs more information from the user label Jan 31, 2025
@Ammaraly
Copy link
Author

Ammaraly commented Feb 1, 2025

@probably-neb

Hey, so I tried to do it with vscode, but it works fine on that.

I also tried starting vscode on wayland as mentioned here microsoft/vscode#207033 (comment)

But the behavior is working as expected on vscode with this setup (it does not show references if ctrl is pressed immediately after clicking on the symbol.

I tried to reproduce this isse on Zed on Macos but it works fine there, as you mentioned it seems to only occur in my linux setup.

@JosephTLyons JosephTLyons added mouse interaction Feedback for mouse interaction states, actions, etc keymap / key binding Feedback for keyboard shortcuts, key mapping, etc labels Feb 1, 2025
@JosephTLyons
Copy link
Collaborator

Although I can't seem to reproduce it right now, I've ran into this a bunch of times on macOS.

@probably-neb
Copy link
Contributor

Alright! Thanks for following up and verifying this is in fact a Zed issue @Ammaraly. We will definitely keep track of this and work on figuring out what's going wrong here.
I'm planning to setup a Wayland install sometime soon as you're not the only one who has had issues on Wayland I've been unable to reproduce with X11.

@andreinonea
Copy link
Contributor

andreinonea commented Feb 1, 2025

Hi there! I am running Zed 0.171.4 with Ubuntu 22.04.5 LTS with Wayland and GNOME Version 42.9 and I can reproduce this as well in Zed, but not in VSCode. Furthermore, I was able to do just the same on macOS 15.2, same Zed version.

However, I found that you have to be extremely quick for this behavior to occur, almost to the point that I imagine the click action has not been released yet, which might trigger the behavior. Perhaps what VSCode is doing different is just keeping track of which input was pressed first?

@Ammaraly
Copy link
Author

Ammaraly commented Feb 8, 2025

Hey,

I would like to report that I just updated Zed to 0.173.4 and the bug is no longer occurring!!

Thanks guys for resolving this so fast 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting info Issue that needs more information from the user keymap / key binding Feedback for keyboard shortcuts, key mapping, etc mouse interaction Feedback for mouse interaction states, actions, etc
Projects
None yet
Development

No branches or pull requests

4 participants