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
This commit is contained in:
smit 2025-02-13 03:42:22 +05:30 committed by GitHub
parent 5dc3c237eb
commit 522b8d662c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,