From 40c18be5416c990af47a9c724430fe4044755cc3 Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Fri, 24 Jan 2025 12:58:17 -0700 Subject: [PATCH] Make editor autoscroll put cursor to the left of scrollbar not under (#23586) Closes #19706 Release Notes: - Improved editor horizontal autoscroll to now place the cursor to the left of the scrollbar rather than under it. --- 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 dac1e6d043c236cc52d4b3e0d6b74af0b4601841..63cc1a254d4abd7aee52280544dc3dbda08d16e3 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -6456,7 +6456,7 @@ impl Element for EditorElement { let autoscrolled = if autoscroll_horizontally { editor.autoscroll_horizontally( start_row, - text_hitbox.size.width, + editor_width - (letter_size.width / 2.0), scroll_width, em_width, &line_layouts, @@ -6541,7 +6541,7 @@ impl Element for EditorElement { let autoscrolled = if autoscroll_horizontally { editor.autoscroll_horizontally( start_row, - text_hitbox.size.width, + editor_width - (letter_size.width / 2.0), scroll_width, em_width, &line_layouts,