make selection a const

This commit is contained in:
Anmol Wadhwani
2024-10-27 21:40:09 +05:30
parent 9190dd3ad7
commit 70d850f8e4

View File

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