fix syntax highlights in dynamic picker (#8206)

This commit is contained in:
Pascal Kuthe 2023-09-09 06:41:49 +02:00 committed by GitHub
parent 14401ff75b
commit eb9c37844c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;