Unnamed repository; edit this file 'description' to name the repository.
Picker: Reset the cursor on prompt change
Michael Davis 2024-07-15
parent 8555248 · commit 009bbda
-rw-r--r--helix-term/src/ui/picker.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs
index ebc06cc0..c65e839c 100644
--- a/helix-term/src/ui/picker.rs
+++ b/helix-term/src/ui/picker.rs
@@ -512,6 +512,8 @@ impl<T: 'static + Send + Sync, D: 'static + Send + Sync> Picker<T, D> {
if self.query == old_query {
return;
}
+ // If the query has meaningfully changed, reset the cursor to the top of the results.
+ self.cursor = 0;
// Have nucleo reparse each changed column.
for (i, column) in self
.columns