-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Labels
bite-sizesmall issuessmall issueseditorFeedback for code editing, formatting, editor iterations, etcFeedback for code editing, formatting, editor iterations, etcgitGit integration feedbackGit integration feedbackreproducibleVerified steps to reproduce includedVerified steps to reproduce included
Description
Summary
Copy Permalink does not work correctly on modified files (links to wrong line)
Steps to reproduce:
- Edit a file in a git repo add a bunch of comment to an existing file
- Right click and select
Copy Permalinkto a line later in the file.
Notice that the linked line number is offset from the code you were trying to link.
For example, given the following committed code:
Lines 129 to 132 in 8e12c67
| items.select_nth_unstable_by(limit, compare); | |
| items.truncate(limit); | |
| items.sort_by(compare); | |
| } |
And the following buffer state:

Copy Permalink gives me this link (line 132):
Line 132 in 8e12c67
| } |
But this is what I expected (line 129):
Line 129 in 8e12c67
| items.select_nth_unstable_by(limit, compare); |
I'm not positive the best behavior, but I think Zed can do better:
- For unchanged/pre-existing lines: line number should be to the line number of that code in the commit.
- For selections/lines which start or end on a newly inserted line (not present in the commit) Zed could expand the selection up/down so that's it's anchored to lines which actually exist in the commit.
Zed Version and System Specs
Zed: v0.167.1 (Zed Preview)
OS: macOS 14.7.0
Memory: 64 GiB
Architecture: aarch64
gerardo-navarro
Metadata
Metadata
Assignees
Labels
bite-sizesmall issuessmall issueseditorFeedback for code editing, formatting, editor iterations, etcFeedback for code editing, formatting, editor iterations, etcgitGit integration feedbackGit integration feedbackreproducibleVerified steps to reproduce includedVerified steps to reproduce included
Type
Projects
Status
Let's Git Together