Position inline-git-blame information at column count
Check for existing issues
- [X] Completed
Describe the feature
This is more of a "UI exploration" thing, I'm not sure yet if it's actually a good idea.
How about an option to constrain the inline git blame to a certain column position? I would consider setting it to never appear to the left of the first line wrap guide (80 cols in my config).
The motivation for this is to avoid causing a seemingly solid block of text when the cursor is on a short line between long lines (e.g. a paragraph break in a long comment)
If applicable, add mockups / screenshots to help present your vision of the feature
No response
That should be relatively easy.
- Define a setting for this
- Use
min(line_width, settings.inline_blame_column*em_width)here: https://github.com/zed-industries/zed/blob/f4f9ca0b1e32f085a8f0ec631b635caf863a9ba1/crates/editor/src/element.rs#L1141
Should be max, not min, but that does indeed do exactly what I described. Most of the work would be adding the setting.
An interesting extension of this would be to snap to the lowest indent guide that is > line length + padding.
Ah, except that logic makes it go out of view if the line is soft-wrapped (e.g. due to inlay hints making it longer than desired). In that case the blame should probably be moved to the last line of the soft-wrapped part.
Ah, except that logic makes it go out of view if the line is soft-wrapped (e.g. due to inlay hints making it longer than desired). In that case the blame should probably be moved to the last line of the soft-wrapped part.
In https://github.com/zed-industries/zed/pull/10600 I just added support for soft-wrapped lines (it was just broken before). It's now displayed next to each wrapped line, which I think makes sense when you think about the "soft_wrap": "preferred_line_length" case, where each line could be cut off at 80 cols.
Hey, can i work on this ? I am new to contributing to Open Source, so would be helpful if there was a manifest of what to do, i believe all the git blame functionality is in the blame.rs file of git crate?
@hshreekar sure, I linked to the code that needs to be edited above.
- Add a
git.inline_blame.min_columnsetting toProjectSettings(anOption<u32>?) - In the code that I linked above, access the project settings
- Use
max(line_width, git.inline_blame.min_column)ifmin_columnis set
This landed in v0.133.0-pre today. Closing this out.