Skip to content

Commit

Permalink
Render diagnostics in the file picker preview (helix-editor#4324)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
the-mikedavis authored and Shekhinah Memmel committed Dec 11, 2022
1 parent ac2f786 commit 0a60180
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion helix-term/src/ui/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,14 @@ impl<T: Item + 'static> Component for FilePicker<T> {

let offset = Position::new(first_line, 0);

let highlights =
let mut highlights =
EditorView::doc_syntax_highlights(doc, offset, area.height, &cx.editor.theme);
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));
}
EditorView::render_text_highlights(
doc,
offset,
Expand Down

0 comments on commit 0a60180

Please sign in to comment.