git: Make permalinks aware of current diffs (#41915)
Siame Rafiq
created
Addressing #22546, we want git permalinks to be aware of the current
changes within the buffer.
This change calculates how many lines have been added/deleted between
the start and end of the selection and uses those values to offset the
selection.
This is done within `Editor::get_permalink_to_line` so that it can be
passed to any git_store.
Example:
<img width="284" height="316" alt="image"
src="https://github.com/user-attachments/assets/268043a0-2fc8-41c1-b094-d650fd4e0ae0"
/>
Where this selections permalink would previously return L3-L9, it now
returns L2-L7.
Release Notes:
- git: make permalinks aware of current diffs
Closes #22546
---
This is my first PR into the zed repository so very happy for any
feedback on how I've implemented this. Thanks!