on master help sign in
Render diagnostics in the file picker preview (#4324)

This is mostly for the sake of the diagnostics pickers: without rendering the diagnostic styles, it's hard to tell where the entries in the picker are pointing to.

commitc47ca331374b28a70c8bb9fd0fe991c478c696a1 authorMichael Davis <mcarsondavis@gmail.com> dateTue 25 Oct 2022, 07:03 (4 years ago) parent001e4e3
1 file changed+7−1
helix-term/src/ui/picker.rs+7−1
helix-term/src/ui/picker.rs+7−1
@@ -248,8 +248,14 @@ impl<T: Item + 'static> Component for FilePicker<T> {
248248
249249 let offset = Position::new(first_line, 0);
250250
251− let highlights =
251+ let mut highlights =
252252 EditorView::doc_syntax_highlights(doc, offset, area.height, &cx.editor.theme);
253+ for spans in EditorView::doc_diagnostics_highlights(doc, &cx.editor.theme) {
254+ if spans.is_empty() {
255+ continue;
256+ }
257+ highlights = Box::new(helix_core::syntax::merge(highlights, spans));
258+ }
253259 EditorView::render_text_highlights(
254260 doc,
255261 offset,