From eb9c37844cae8af1ca5039581ed767e602eb0ef1 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Sat, 9 Sep 2023 06:41:49 +0200 Subject: fix syntax highlights in dynamic picker (#8206) --- helix-term/src/ui/picker.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index a8411f53..94a69b0d 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -474,9 +474,13 @@ impl Picker { log::info!("highlighting picker item failed"); return; }; - let Some(Overlay { - content: picker, .. - }) = compositor.find::>() + let picker = match compositor.find::>() { + Some(Overlay { content, .. }) => Some(content), + None => compositor + .find::>>() + .map(|overlay| &mut overlay.content.file_picker), + }; + let Some(picker) = picker else { log::info!("picker closed before syntax highlighting finished"); return; -- cgit v1.2.3-70-g09d2