Make inlay hint cache tests pass
Co-Authored-By: Conrad <conrad.irwin@gmail.com>
This commit is contained in:
@@ -11,19 +11,18 @@ pub enum ScrollAmount {
|
||||
|
||||
impl ScrollAmount {
|
||||
pub fn lines(&self, editor: &mut Editor) -> f32 {
|
||||
todo!()
|
||||
// match self {
|
||||
// Self::Line(count) => *count,
|
||||
// Self::Page(count) => editor
|
||||
// .visible_line_count()
|
||||
// .map(|mut l| {
|
||||
// // for full pages subtract one to leave an anchor line
|
||||
// if count.abs() == 1.0 {
|
||||
// l -= 1.0
|
||||
// }
|
||||
// (l * count).trunc()
|
||||
// })
|
||||
// .unwrap_or(0.),
|
||||
// }
|
||||
match self {
|
||||
Self::Line(count) => *count,
|
||||
Self::Page(count) => editor
|
||||
.visible_line_count()
|
||||
.map(|mut l| {
|
||||
// for full pages subtract one to leave an anchor line
|
||||
if count.abs() == 1.0 {
|
||||
l -= 1.0
|
||||
}
|
||||
(l * count).trunc()
|
||||
})
|
||||
.unwrap_or(0.),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user