summaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorMichael Davis2022-10-25 12:03:35 +0000
committerGitHub2022-10-25 12:03:35 +0000
commitc47ca331374b28a70c8bb9fd0fe991c478c696a1 (patch)
tree1fe19e0ba575948cd9effe65233b3dbcd7c14ea2 /helix-term/src
parent001e4e304b6177148b8a74a222e0d02b91f53a11 (diff)
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.
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/ui/picker.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs
index c7149c61..2505f219 100644
--- a/helix-term/src/ui/picker.rs
+++ b/helix-term/src/ui/picker.rs
@@ -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,