term: Stop user scroll passed the end of a diff

This commit is contained in:
Alexis Sellier 2024-07-07 11:54:10 +02:00
parent d221095980
commit 13707fee32
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -78,7 +78,7 @@ fn main<E: Element>(
recv(events_rx) -> event => {
let event = event??;
let page = height as usize - 1; // Don't count the status bar.
let end = lines.len() - page;
let end = if page > lines.len() { 0 } else { lines.len() - page };
let prev = line;
match event {