From e2e529bd943dd0b5c915fc0efdb332757e0541de Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Thu, 10 Jul 2025 11:03:34 -0600 Subject: [PATCH] Remove redundant `autoscroll_horizontally` during editor prepaint (#34218) * Experimentally `scroll_manager.anchor()` appears to be the same before and after this 2nd call of `autoscroll_horizontally` * Nothing these depend on seem to be mutated between the calls (and since this is prepaint, stuff within editor also shouldn't be mutated) Release Notes: - N/A Co-authored-by: Finn --- crates/editor/src/element.rs | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 8a5bfb3babdc2a1f3b2594e6b97c8b7d2751e180..014583912fd3233d3bc1872188a15679d766ff2b 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -8614,29 +8614,6 @@ impl Element for EditorElement { cx, ); - self.editor.update(cx, |editor, cx| { - let clamped = editor.scroll_manager.clamp_scroll_left(scroll_max.x); - - let autoscrolled = if autoscroll_horizontally { - editor.autoscroll_horizontally( - start_row, - editor_content_width, - scroll_width, - em_advance, - &line_layouts, - window, - cx, - ) - } else { - false - }; - - if clamped || autoscrolled { - snapshot = editor.snapshot(window, cx); - scroll_position = snapshot.scroll_position(); - } - }); - let line_elements = self.prepaint_lines( start_row, &mut line_layouts,