aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/editor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/ui/editor.rs')
-rw-r--r--helix-term/src/ui/editor.rs20
1 files changed, 18 insertions, 2 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 7a5e4aa5..ae48950f 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -283,10 +283,26 @@ impl EditorView {
let style: Style = theme.get("ui.linenr");
let warning: Style = theme.get("warning");
+ let error: Style = theme.get("error");
+ let info: Style = theme.get("info");
+ let hint: Style = theme.get("hint");
+
let last_line = view.last_line();
for (i, line) in (view.first_line..last_line).enumerate() {
- if view.doc.diagnostics.iter().any(|d| d.line == line) {
- surface.set_stringn(viewport.x - OFFSET, viewport.y + i as u16, "●", 1, warning);
+ use helix_core::diagnostic::Severity;
+ if let Some(diagnostic) = view.doc.diagnostics.iter().find(|d| d.line == line) {
+ surface.set_stringn(
+ viewport.x - OFFSET,
+ viewport.y + i as u16,
+ "●",
+ 1,
+ match diagnostic.severity {
+ Some(Severity::Error) => error,
+ Some(Severity::Warning) | None => warning,
+ Some(Severity::Info) => info,
+ Some(Severity::Hint) => hint,
+ },
+ );
}
surface.set_stringn(