Use the alt
modifier when going to a definition with cmd-click
#38148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I don't totally follow how the
cmd_click_reveal_task
function works, but it branches on whetherself.hovered_link_state
exists and contains any links, and in case it doesn't, it doesn't usemodifiers.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: