zed icon indicating copy to clipboard operation
zed copied to clipboard

Go to definition opens new tab even if target file is already open in another panel

Open N8th8n8el opened this issue 2 years ago • 6 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

Steps to reproude (for me this is a typescript project, but don't think it matters):

  • Have file A which contains the definition for something that is used in file B.
  • Have file A open on the left and file B on the right in a split panel configuration.
  • Click on Go to definition on the thing in file B. -> Opens up file A in the right panel instead of focusing the already open file on the left.

I find this a bit annoying when I, for example, have code open on the left and a test file on the right.

Environment

Zed: v0.72.5 (stable) OS: macOS 13.1.0 Memory: 16 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

No response

N8th8n8el avatar Feb 14 '23 09:02 N8th8n8el

I guess it is debatable whether this is a bug or a feature request.

N8th8n8el avatar Feb 14 '23 09:02 N8th8n8el

Hey @N8th8n8el, do you use another editor that has this behavior? I believe VS Code, by default, does what we are doing right now.

JosephTLyons avatar Feb 14 '23 15:02 JosephTLyons

intellij based ides like goland have it for sure capture-20230214162352

aexvir avatar Feb 14 '23 15:02 aexvir

intellij based ides like goland have it for sure capture-20230214162352

Yeah, this makes sense to include it as a setting. If we added this behavior, we'd likely put it behind a setting as well.

JosephTLyons avatar Feb 14 '23 15:02 JosephTLyons

Hey @N8th8n8el, do you use another editor that has this behavior? I believe VS Code, by default, does what we are doing right now.

intellij based ides like goland have it for sure

Exactly, I used WebStorm before. A setting would be fine.

N8th8n8el avatar Feb 14 '23 15:02 N8th8n8el

Using splits to group / organize files is very handy for workflow.

With the current behavior, the editor essentially throws chaos into intentionally organized splits, which erodes flow. Grouping splits quickly begins to feel futile. It shouldn't be futile! It's a handy technique.

Thanks @N8th8n8el for opening the issue. 🙏

blackeyeddan avatar Mar 04 '24 23:03 blackeyeddan