ZIm/crates
tims 34d0b57945
editor: Fix inline Git blame not visible on long lines due to overflow (#23374)
Closes #18702

This is take 2 of [my previous
PR](https://github.com/zed-industries/zed/pull/19555), which was closed
due to inactivity and merge conflicts.

**Cause**: 

The editor's horizontal scroll width only considers the longest line in
the buffer, using `layout_line` for `longest_row`. The inline blame
width isn’t included in it because it is just a decoration on top of the
line (think of like CSS absolute) and not part of its actual content.
This causes blame to overflow.

**Solution**:

Along with `longest_row` width we also add that line's inline blame
width for scroll width calculation. We also have to add some padding
that is between inline blame and line's content.

**Alternate Solution**:

In my previous PR, instead of adding the inline blame width of the
longest line for scroll width calculation, I used the inline blame of
the current line the cursor is on (since we only see the blame for the
current line). I added that to the current line's width, giving us the
full width of that row. Then, we compare that row's width with the
longest row width and use the max of the two for the scroll width
calculation.

While this solution seems clever, it's overly complicated and could
cause issues, like the scroll width changing every time you move the
cursor up or down. I don't think we should go with this, but I'm open to
suggestions.

**Preview**:

Before:


https://github.com/user-attachments/assets/01ef90cf-06e7-4ebb-8bd1-637a53e0654e

After:


https://github.com/user-attachments/assets/b13616de-bdea-4da4-b32d-9c4104448166


Release Notes:

- Fixed inline Git blame not visible on long lines due to overflow.
2025-01-28 10:47:11 +02:00
..
activity_indicator Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
anthropic Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
assets Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
assistant Fix window double borrows (#23739) 2025-01-27 21:56:29 +00:00
assistant2 assistant2: Add tiny visual adjustments (#23748) 2025-01-27 20:26:34 -03:00
assistant_context_editor Fix window double borrows (#23739) 2025-01-27 21:56:29 +00:00
assistant_settings Add DeepSeek support (#23551) 2025-01-27 13:40:59 -05:00
assistant_slash_command Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
assistant_slash_commands Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
assistant_tool Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
assistant_tools Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
audio Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
auto_update Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
auto_update_ui Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
breadcrumbs Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
call Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
channel Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
cli Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
client Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
clock chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
collab project_panel: Add Alt/Opt+Click to expand/collapse a directory and all its contents (#22896) 2025-01-28 10:37:56 +02:00
collab_ui Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
collections chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
command_palette Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
command_palette_hooks Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
context_server Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
context_server_settings Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
copilot Fix window double borrows (#23739) 2025-01-27 21:56:29 +00:00
db Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
deepseek Add DeepSeek support (#23551) 2025-01-27 13:40:59 -05:00
diagnostics Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
docs_preprocessor Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
editor editor: Fix inline Git blame not visible on long lines due to overflow (#23374) 2025-01-28 10:47:11 +02:00
evals Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
extension Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
extension_api chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
extension_cli chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
extension_host Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
extensions_ui Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
feature_flags Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
feedback Update actions to open GitHub issue templates (#23747) 2025-01-27 18:17:43 -05:00
file_finder Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
file_icons Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
fireworks chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
fs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
fsevent chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
fuzzy chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
git Fix unnecessarily large edits emitted from multi buffer on diff recalculation (#23753) 2025-01-27 18:11:15 -08:00
git_hosting_providers Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
git_ui Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
go_to_line Fix window double borrows (#23739) 2025-01-27 21:56:29 +00:00
google_ai chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
gpui windows: Refactor mouse events related code (#23729) 2025-01-28 15:48:43 +08:00
gpui_macros Fix window double borrows (#23739) 2025-01-27 21:56:29 +00:00
html_to_markdown Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
http_client chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
image_viewer Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
indexed_docs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
inline_completion Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
inline_completion_button Fix window double borrows (#23739) 2025-01-27 21:56:29 +00:00
install_cli Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
journal Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
language Silence Rust-Analyzer false-positive (#23724) 2025-01-27 16:38:03 +00:00
language_extension Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
language_model Add DeepSeek support (#23551) 2025-01-27 13:40:59 -05:00
language_model_selector assistant: Preserve selection focus in the model selector (#23713) 2025-01-27 12:29:08 -03:00
language_models Add DeepSeek support (#23551) 2025-01-27 13:40:59 -05:00
language_selector Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
language_tools Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
languages Add auto-completion support for snippet files (#23698) 2025-01-27 12:32:22 +01:00
livekit_client Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
livekit_client_macos Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
livekit_server chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
lmstudio Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
lsp Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
markdown Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
markdown_preview Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
media chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
menu chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
multi_buffer Fix run indicators with expanded diff hunks (#23758) 2025-01-27 23:05:46 -07:00
node_runtime chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
notifications Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
ollama Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
open_ai openai: Add back O1-Preview (#23715) 2025-01-27 14:44:12 +00:00
outline Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
outline_panel Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
paths Add auto-completion support for snippet files (#23698) 2025-01-27 12:32:22 +01:00
picker Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
prettier Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
project project_panel: Add Alt/Opt+Click to expand/collapse a directory and all its contents (#22896) 2025-01-28 10:37:56 +02:00
project_panel project_panel: Add precise drag-and-drop for files onto folded directories (#22983) 2025-01-28 10:42:10 +02:00
project_symbols Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
prompt_library Fix window double borrows (#23739) 2025-01-27 21:56:29 +00:00
proto project_panel: Add Alt/Opt+Click to expand/collapse a directory and all its contents (#22896) 2025-01-28 10:37:56 +02:00
recent_projects Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
refineable project: Revert project tree impl (again) (#23572) 2025-01-23 16:10:38 -05:00
release_channel Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
remote Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
remote_server Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
repl Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
reqwest_client Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
rich_text Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
rope Rework go to line infrastructure (#23654) 2025-01-25 19:24:19 +00:00
rpc Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
search Fix window double borrows (#23739) 2025-01-27 21:56:29 +00:00
semantic_index Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
semantic_version chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
session Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
settings Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
settings_ui Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
snippet Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
snippet_provider Add auto-completion support for snippet files (#23698) 2025-01-27 12:32:22 +01:00
snippets_ui Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
sqlez Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
sqlez_macros chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
story Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
storybook Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
streaming_diff chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
sum_tree Rework diff rendering to allow putting the cursor into deleted text, soft-wrapping and scrolling deleted text correctly (#22994) 2025-01-24 14:18:22 -07:00
supermaven Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
supermaven_api Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
tab_switcher Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
task Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
tasks_ui Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
telemetry chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
telemetry_events chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
terminal Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
terminal_view Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
text Fix unnecessarily large edits emitted from multi buffer on diff recalculation (#23753) 2025-01-27 18:11:15 -08:00
theme Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
theme_extension Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
theme_importer Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
theme_selector Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
time_format chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
title_bar Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
toolchain_selector Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
ui Add DeepSeek support (#23551) 2025-01-27 13:40:59 -05:00
ui_input Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
ui_macros Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
util Canonicalize paths when running tests (#23655) 2025-01-26 14:56:07 +08:00
vcs_menu Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
vim vim: Fix NextSubwordEnd crash (#23604) 2025-01-27 23:13:13 -07:00
vim_mode_setting Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
welcome Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
workspace workspace: Prefer active window over other local non-collab windows for opening file (#23726) 2025-01-27 23:11:35 -07:00
worktree project_panel: Add Alt/Opt+Click to expand/collapse a directory and all its contents (#22896) 2025-01-28 10:37:56 +02:00
zed Fix window double borrows (#23739) 2025-01-27 21:56:29 +00:00
zed_actions Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
zed_predict_tos Remove more references to 'model' in GPUI APIs (#23693) 2025-01-27 04:00:27 +00:00
zeta Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00