Skip to content

Commit

Permalink
fix syntax highlights in dynamic picker (#8206)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalkuthe authored Sep 9, 2023
1 parent 14401ff commit eb9c378
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions helix-term/src/ui/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eb9c378

Please sign in to comment.