don't scroll past end

This commit is contained in:
Jana Dönszelmann 2026-02-24 23:19:49 +01:00
parent f3bc16b3c5
commit 01774cb9c2
No known key found for this signature in database

View file

@ -198,8 +198,8 @@ impl LogViewer {
res.push(i); res.push(i);
} }
if self.curr.selection_offset > res.len() { if res.len() > 0 && self.curr.selection_offset > res.len() - 1 {
self.curr.selection_offset = res.len(); self.curr.selection_offset = res.len() - 1;
} }
Some((res, self.curr.selection_offset)) Some((res, self.curr.selection_offset))