Fix jank in LSP debug log autoscroll (#22998)

Not sure why scroll was janky with `Autoscroll::newest()`, but this
appears to fix it. Probably better to conditionally do the autoscroll
requests anyway.

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-01-10 22:59:21 -07:00 committed by GitHub
parent bbbd1e9902
commit b65dc8c566
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View file

@ -32,10 +32,16 @@ impl Autoscroll {
pub fn focused() -> Self {
Self::Strategy(AutoscrollStrategy::Focused)
}
/// Scrolls so that the newest cursor is roughly an n-th line from the top.
pub fn top_relative(n: usize) -> Self {
Self::Strategy(AutoscrollStrategy::TopRelative(n))
}
/// Scrolls so that the newest cursor is at the bottom.
pub fn bottom() -> Self {
Self::Strategy(AutoscrollStrategy::Bottom)
}
}
#[derive(PartialEq, Eq, Default, Clone, Copy)]