Simplified page down implementation

Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
This commit is contained in:
Hanif Bin Ariffin 2021-06-12 20:34:21 +08:00
parent 9ed5091be6
commit 083e745976

View file

@ -297,10 +297,7 @@ impl<'a> Pager<'a> {
} }
fn page_down(&mut self) { fn page_down(&mut self) {
self.upper_mark = self self.upper_mark = self.upper_mark.saturating_add(self.content_rows.into());
.upper_mark
.saturating_add(self.content_rows.into())
.min(self.line_count.saturating_sub(self.content_rows.into()));
} }
fn page_up(&mut self) { fn page_up(&mut self) {