Skip to content

Commit

Permalink
fix syntax highlights in dynamic picker (helix-editor#8206)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalkuthe authored and mtoohey31 committed Jun 2, 2024
1 parent de56499 commit 65bc7e8
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 65bc7e8

Please sign in to comment.