Add an out of bounds check for mouse-selected themes in +list-themes

This commit is contained in:
Anmol Wadhwani
2024-10-27 20:51:21 +05:30
parent e26847ccd4
commit 9190dd3ad7

View File

@ -515,7 +515,9 @@ const Preview = struct {
}
if (theme_list.hasMouse(mouse)) |_| {
if (mouse.button == .left and mouse.type == .release) {
self.current = self.window + mouse.row;
if (self.window + mouse.row < self.filtered.items.len) {
self.current = self.window + mouse.row;
}
}
highlight = mouse.row;
}