Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/ui/picker.rs')
| -rw-r--r-- | helix-term/src/ui/picker.rs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 5a4b3afb..7abdfce8 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -940,21 +940,18 @@ impl<T: 'static + Send + Sync, D: 'static + Send + Sync> Picker<T, D> { } } - let syntax_highlights = EditorView::doc_syntax_highlights( + let loader = cx.editor.syn_loader.load(); + + let syntax_highlighter = + EditorView::doc_syntax_highlighter(doc, offset.anchor, area.height, &loader); + let mut overlay_highlights = Vec::new(); + + EditorView::doc_diagnostics_highlights_into( doc, - offset.anchor, - area.height, &cx.editor.theme, + &mut overlay_highlights, ); - let mut overlay_highlights = - EditorView::empty_highlight_iter(doc, offset.anchor, area.height); - for spans in EditorView::doc_diagnostics_highlights(doc, &cx.editor.theme) { - if spans.is_empty() { - continue; - } - overlay_highlights = Box::new(helix_core::syntax::merge(overlay_highlights, spans)); - } let mut decorations = DecorationManager::default(); if let Some((start, end)) = range { @@ -984,7 +981,7 @@ impl<T: 'static + Send + Sync, D: 'static + Send + Sync> Picker<T, D> { offset, // TODO: compute text annotations asynchronously here (like inlay hints) &TextAnnotations::default(), - syntax_highlights, + syntax_highlighter, overlay_highlights, &cx.editor.theme, decorations, |