fix: stop selection from running off the bottom of the recent files list

This commit is contained in:
CJ van den Berg 2024-04-09 22:41:26 +02:00
parent 48fc8a968c
commit b8261f924e

View file

@ -154,7 +154,7 @@ pub fn State(ctx_type: type) type {
self.selected = 0;
return;
};
self.selected = @min(current + 1, self.count() - 1);
self.selected = @min(current + 1, self.count() - self.header_count - 1);
}
pub fn select_up(self: *Self) void {