fix: fixed palette selected row position on move down

This commit is contained in:
metiftikci authored and Wez Furlong committed 2024-01-23 05:49:09 -07:00
1 parent 76028ca154
commit ff4e648834
1 file changed
+1 -1
+1 -1
View File
@@ -567,7 +567,7 @@ impl CommandPalette {
let mut row = self.selected_row.borrow_mut();
*row = row.saturating_add(1).min(limit);
let mut top_row = self.top_row.borrow_mut();
if *row + *top_row > max_rows_on_screen - 1 {
if *row > *top_row + max_rows_on_screen - 1 {
*top_row = row.saturating_sub(max_rows_on_screen - 1);
}
}