Clarify logic for Autoscroll::newest()
and Autoscroll::fit()
(#23048)
Release Notes: - N/A
This commit is contained in:
parent
6aba3950d2
commit
e08484840b
1 changed files with 2 additions and 2 deletions
|
@ -128,9 +128,9 @@ impl Editor {
|
||||||
.next_row()
|
.next_row()
|
||||||
.as_f32();
|
.as_f32();
|
||||||
|
|
||||||
// If the selections can't all fit on screen, scroll to the newest.
|
let selections_fit = target_bottom - target_top <= visible_lines;
|
||||||
if autoscroll == Autoscroll::newest()
|
if autoscroll == Autoscroll::newest()
|
||||||
|| autoscroll == Autoscroll::fit() && target_bottom - target_top > visible_lines
|
|| (autoscroll == Autoscroll::fit() && !selections_fit)
|
||||||
{
|
{
|
||||||
let newest_selection_top = selections
|
let newest_selection_top = selections
|
||||||
.iter()
|
.iter()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue