on master help sign in
DynamicPicker: Reset idle timeout on refresh
35cf972Michael Davis
helix-term/src/ui/picker.rs+2−1
@@ -798,7 +798,7 @@ impl<T: Item + Send + 'static> Component for DynamicPicker<T> {
798 cx.jobs.callback(async move {
798 cx.jobs.callback(async move {
799 let new_options = new_options.await?;
799 let new_options = new_options.await?;
800 let callback =
800 let callback =
801− crate::job::Callback::EditorCompositor(Box::new(move |_editor, compositor| {
801+ crate::job::Callback::EditorCompositor(Box::new(move |editor, compositor| {
802 // Wrapping of pickers in overlay is done outside the picker code,
802 // Wrapping of pickers in overlay is done outside the picker code,
803 // so this is fragile and will break if wrapped in some other widget.
803 // so this is fragile and will break if wrapped in some other widget.
804 let picker = match compositor.find_id::<Overlay<DynamicPicker<T>>>(Self::ID) {
804 let picker = match compositor.find_id::<Overlay<DynamicPicker<T>>>(Self::ID) {
@@ -808,6 +808,7 @@ impl<T: Item + Send + 'static> Component for DynamicPicker<T> {
808 picker.options = new_options;
808 picker.options = new_options;
809 picker.cursor = 0;
809 picker.cursor = 0;
810 picker.force_score();
810 picker.force_score();
811+ editor.reset_idle_timer();
811 }));
812 }));
812 anyhow::Ok(callback)
813 anyhow::Ok(callback)
813 });
814 });