From 522b8d662cc1adc02ac97b686e902d5f55930381 Mon Sep 17 00:00:00 2001 From: smit <0xtimsb@gmail.com> Date: Thu, 13 Feb 2025 03:42:22 +0530 Subject: [PATCH] editor: Fix autoscroll flickering regression (#24758) This PR fixes autoscroll flickering issue caused by recent [#24735](https://github.com/zed-industries/zed/pull/24735) which fixes soft wrap scroll issues. No release notes, as this was few hours ago. Adding vertical scrollbar width to viewport width, so that autoscroll function don't try to that much pixels extra. Release Notes: - N/A --- crates/editor/src/element.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index a13278a401..9a5b7da6ff 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -7188,7 +7188,7 @@ impl Element for EditorElement { let autoscrolled = if autoscroll_horizontally { editor.autoscroll_horizontally( start_row, - editor_width - (letter_size.width / 2.0), + editor_width - (letter_size.width / 2.0) + style.scrollbar_width, scroll_width, em_width, &line_layouts, @@ -7279,7 +7279,7 @@ impl Element for EditorElement { let autoscrolled = if autoscroll_horizontally { editor.autoscroll_horizontally( start_row, - editor_width - (letter_size.width / 2.0), + editor_width - (letter_size.width / 2.0) + style.scrollbar_width, scroll_width, em_width, &line_layouts,