Disable editor autoscroll on mouse clicks (#20287)

Closes #18148

Release Notes:

- Stop scrolling when clicking to the edges of the visible text area.
Use `autoscroll_on_clicks` to configure this behavior.


https://github.com/user-attachments/assets/3afd5cbb-5957-4e39-94c6-cd2e927038fd

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
This commit is contained in:
Haru Kim
2024-11-29 13:51:36 +02:00
committed by GitHub
co-authored by Kirill Bulatov
parent eadb107339
commit f9d5de834a
4 changed files with 19 additions and 1 deletions
+2 -1
View File
@@ -2931,7 +2931,7 @@ impl Editor {
let start;
let end;
let mode;
let auto_scroll;
let mut auto_scroll;
match click_count {
1 => {
start = buffer.anchor_before(position.to_point(&display_map));
@@ -2967,6 +2967,7 @@ impl Editor {
auto_scroll = false;
}
}
auto_scroll &= !EditorSettings::get_global(cx).autoscroll_on_clicks;
let point_to_delete: Option<usize> = {
let selected_points: Vec<Selection<Point>> =