From b8261f924e9f2d6ace772bb3a90354882621f1d5 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 9 Apr 2024 22:41:26 +0200 Subject: [PATCH] fix: stop selection from running off the bottom of the recent files list --- src/tui/Menu.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tui/Menu.zig b/src/tui/Menu.zig index 02cfab1..dece251 100644 --- a/src/tui/Menu.zig +++ b/src/tui/Menu.zig @@ -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 {