fix syntax highlights in dynamic picker (#8206)

main
Pascal Kuthe 1 year ago committed by GitHub
parent 14401ff75b
commit eb9c37844c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save