diff options
author | Pascal Kuthe | 2023-09-09 04:41:49 +0000 |
---|---|---|
committer | GitHub | 2023-09-09 04:41:49 +0000 |
commit | eb9c37844cae8af1ca5039581ed767e602eb0ef1 (patch) | |
tree | 9bbba4b7a776882020815112a5b27a7e994ca08a | |
parent | 14401ff75b90cbd98d39eb4b7b5442ad43b49e31 (diff) |
fix syntax highlights in dynamic picker (#8206)
-rw-r--r-- | helix-term/src/ui/picker.rs | 10 |
1 files 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<T: Item + 'static> Picker<T> { log::info!("highlighting picker item failed"); return; }; - let Some(Overlay { - content: picker, .. - }) = compositor.find::<Overlay<Self>>() + let picker = match compositor.find::<Overlay<Self>>() { + Some(Overlay { content, .. }) => Some(content), + None => compositor + .find::<Overlay<DynamicPicker<T>>>() + .map(|overlay| &mut overlay.content.file_picker), + }; + let Some(picker) = picker else { log::info!("picker closed before syntax highlighting finished"); return; |