mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
Autoscroll containing element when editor has a pending selection (#10931)
Release Notes: - N/A
This commit is contained in:
parent
25e239d986
commit
e1791b7dd0
@ -3501,10 +3501,11 @@ impl Element for EditorElement {
|
||||
let content_origin =
|
||||
text_hitbox.origin + point(gutter_dimensions.margin, Pixels::ZERO);
|
||||
|
||||
let mut autoscroll_requested = false;
|
||||
let mut autoscroll_containing_element = false;
|
||||
let mut autoscroll_horizontally = false;
|
||||
self.editor.update(cx, |editor, cx| {
|
||||
autoscroll_requested = editor.autoscroll_requested();
|
||||
autoscroll_containing_element =
|
||||
editor.autoscroll_requested() || editor.has_pending_selection();
|
||||
autoscroll_horizontally = editor.autoscroll_vertically(bounds, line_height, cx);
|
||||
snapshot = editor.snapshot(cx);
|
||||
});
|
||||
@ -3683,7 +3684,7 @@ impl Element for EditorElement {
|
||||
scroll_pixel_position,
|
||||
line_height,
|
||||
em_width,
|
||||
autoscroll_requested,
|
||||
autoscroll_containing_element,
|
||||
cx,
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user