From 8c68074fa6d2e3771bbc1a7f80bc9b422a787da4 Mon Sep 17 00:00:00 2001 From: chtenb Date: Sat, 25 Nov 2023 14:27:31 +0100 Subject: Fix precedence of ui.virtual.whitespace (#8879) * Revert "Revert "Fix precedence of ui.virtual.whitespace (#8750)"" This reverts commit 811d62d3b3699efb7b7ceb362f537979e5911871. * Fix ui.text overwriting the syntax highlighting Adjust ui.text description--- helix-term/src/ui/picker.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'helix-term/src/ui/picker.rs') diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 0214a391..9ba45335 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -736,17 +736,20 @@ impl Picker { } } - let mut highlights = EditorView::doc_syntax_highlights( + let syntax_highlights = EditorView::doc_syntax_highlights( doc, offset.anchor, area.height, &cx.editor.theme, ); + + 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; } - highlights = Box::new(helix_core::syntax::merge(highlights, spans)); + overlay_highlights = Box::new(helix_core::syntax::merge(overlay_highlights, spans)); } let mut decorations: Vec> = Vec::new(); @@ -777,7 +780,8 @@ impl Picker { offset, // TODO: compute text annotations asynchronously here (like inlay hints) &TextAnnotations::default(), - highlights, + syntax_highlights, + overlay_highlights, &cx.editor.theme, &mut decorations, &mut [], -- cgit v1.2.3-70-g09d2