Skip to content

Conversation

timvermeulen
Copy link
Contributor

@timvermeulen timvermeulen commented Sep 14, 2025

I don't totally follow how the cmd_click_reveal_task function works, but it branches on whether self.hovered_link_state exists and contains any links, and in case it doesn't, it doesn't use modifiers.alt for deciding where to navigate. This PR addresses that.

The problem I've been having is that cmd-alt-click sometimes behaves as cmd-click, i.e. it navigates to the definition in the current pane. This appears to happen whenever I cmd-alt-click while the symbol I'm hovering over isn't underlined, possibly when I click too quickly?

An alternative way to reliably reproduce this is to cmd-alt-click on a symbol without letting go of cmd and alt and without moving the cursor. Now the symbol is no longer underlined (and the hover preview has disappeared as well), so clicking again (while still holding cmd and alt) goes to the definition in the current pane:

cmd-alt-click.mov

Release notes:

  • Fixed a bug that caused cmd-alt-click to sometimes go to the definition in the current pane

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Sep 14, 2025
@zed-industries-bot
Copy link

zed-industries-bot commented Sep 17, 2025

Warnings
⚠️

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against 8e909fe

@timvermeulen timvermeulen force-pushed the alt-modifier-cmd-click branch 2 times, most recently from 026eb57 to f944a7f Compare September 23, 2025 17:58
@JosephTLyons
Copy link
Collaborator

Thank you!

@JosephTLyons JosephTLyons merged commit 0266a99 into zed-industries:main Sep 30, 2025
22 checks passed
rtfeldman pushed a commit that referenced this pull request Oct 2, 2025
)

I don't totally follow how the `cmd_click_reveal_task` function works,
but it branches on whether `self.hovered_link_state` exists and contains
any links, and in case it doesn't, it doesn't use `modifiers.alt` for
deciding where to navigate. This PR addresses that.

The problem I've been having is that cmd-alt-click sometimes behaves as
cmd-click, i.e. it navigates to the definition in the current pane. This
appears to happen whenever I cmd-alt-click while the symbol I'm hovering
over isn't underlined, possibly when I click too quickly?

An alternative way to reliably reproduce this is to cmd-alt-click on a
symbol without letting go of cmd and alt and without moving the cursor.
Now the symbol is no longer underlined (and the hover preview has
disappeared as well), so clicking again (while still holding cmd and
alt) goes to the definition in the current pane:


https://github.com/user-attachments/assets/34003e01-fd95-4741-8a7d-6240d1c5a495

Release notes:

- Fixed a bug that caused cmd-alt-click to sometimes go to the
definition in the current pane

Co-authored-by: Joseph T. Lyons <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants