zed icon indicating copy to clipboard operation
zed copied to clipboard

Ability to navigate to exact search result instance

Open Rafi993 opened this issue 1 year ago • 2 comments

Check for existing issues

  • [X] Completed

Describe the feature

  • When you search for an item. You are not able to navigate to exact search instance. If you click on the file name in the search result it takes you to the file but not to the exact search instance
  • You should be able to click on the instance found in the search result and navigate to the exact line where the result was found

Rafi993 avatar Apr 15 '24 04:04 Rafi993

While less discoverable compared to the "file name", all other separators are clickable too: Screenshot 2024-04-15 at 08 41 57

as well as the navigate arrow in the gutter: Screenshot 2024-04-15 at 08 41 48

also, "file name" per se hints the same shortcut (alt-enter) by default: image

which works in any place inside of the search results — if one places the caret and presses the shortcut, the whole file will be opened at this position.

So, functionality-wise, Zed seems to support what's being requested, it's the learning path/discoverability that's not well. Not sure what to do about this, but maybe somebody else has ideas?

SomeoneToIgnore avatar Apr 15 '24 05:04 SomeoneToIgnore

While less discoverable compared to the "file name", all other separators are clickable too: Screenshot 2024-04-15 at 08 41 57

as well as the navigate arrow in the gutter: Screenshot 2024-04-15 at 08 41 48

also, "file name" per se hints the same shortcut (alt-enter) by default: image

which works in any place inside of the search results — if one places the caret and presses the shortcut, the whole file will be opened at this position.

So, functionality-wise, Zed seems to support what's being requested, it's the learning path/discoverability that's not well. Not sure what to do about this, but maybe somebody else has ideas?

It would be awesome if one could do option + click or just click on the the highlighted instance to directly navigate there.

Rafi993 avatar Apr 16 '24 03:04 Rafi993

+1 to this issue; it took me searching for this issue to figure out the functionality exists :joy: . Two suggestions, both of which can be independently implemented:

  1. Clicking line numbers takes you to the file at that line. This is what GitHub code search does. Right now clicking line numbers just selects the line which is reasonable functionality to lose in the search view.
  2. Ctrl/Option + hover changes cursor to clickable and on click navigates to the file

I do think it's useful to not have click directly take you to it so that you can directly edit or copy from search results.

MatthewScholefield avatar Jul 17 '24 08:07 MatthewScholefield