aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorPascal Kuthe2023-09-09 04:41:49 +0000
committerGitHub2023-09-09 04:41:49 +0000
commiteb9c37844cae8af1ca5039581ed767e602eb0ef1 (patch)
tree9bbba4b7a776882020815112a5b27a7e994ca08a /helix-term
parent14401ff75b90cbd98d39eb4b7b5442ad43b49e31 (diff)
fix syntax highlights in dynamic picker (#8206)
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/ui/picker.rs10
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;