From 86cc5c2b55f9b69060f5dd54fb8105355c0acf9e Mon Sep 17 00:00:00 2001 From: neunato Date: Tue, 6 May 2025 09:05:08 +0200 Subject: [PATCH] Apply `autoscroll_on_clicks` when extending selection (#28235) Closes https://github.com/zed-industries/zed/issues/22240 Release Notes: - Fixed `autoscroll_on_clicks` not being applied when expanding selection Co-authored-by: Kirill Bulatov --- crates/editor/src/editor.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 4e3ace4949..7b6f2e9956 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -2952,7 +2952,9 @@ impl Editor { _ => {} } - self.change_selections(Some(Autoscroll::fit()), window, cx, |s| { + let auto_scroll = EditorSettings::get_global(cx).autoscroll_on_clicks; + + self.change_selections(auto_scroll.then(Autoscroll::fit), window, cx, |s| { s.set_pending(pending_selection, pending_mode) }); }