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 <kirill@zed.dev>
This commit is contained in:
neunato 2025-05-06 09:05:08 +02:00 committed by GitHub
parent a0bfe4d293
commit 86cc5c2b55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
});
}