diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs index 7437cbd07..aeee5ef3e 100644 --- a/helix-term/src/ui/statusline.rs +++ b/helix-term/src/ui/statusline.rs @@ -240,10 +240,12 @@ fn render_diagnostics(context: &mut RenderContext, write: F) counts }); + let sym = &context.editor.config().diagnostics_symbol; + if warnings > 0 { write( context, - "●".to_string(), + sym.to_string(), Some(context.editor.theme.get("warning")), ); write(context, format!(" {} ", warnings), None); @@ -252,7 +254,7 @@ fn render_diagnostics(context: &mut RenderContext, write: F) if errors > 0 { write( context, - "●".to_string(), + sym.to_string(), Some(context.editor.theme.get("error")), ); write(context, format!(" {} ", errors), None); @@ -277,6 +279,7 @@ fn render_workspace_diagnostics(context: &mut RenderContext, write: F) } counts }); + let sym = &context.editor.config().diagnostics_symbol; if warnings > 0 || errors > 0 { write(context, " W ".into(), None); @@ -285,7 +288,7 @@ fn render_workspace_diagnostics(context: &mut RenderContext, write: F) if warnings > 0 { write( context, - "●".to_string(), + sym.to_string(), Some(context.editor.theme.get("warning")), ); write(context, format!(" {} ", warnings), None); @@ -294,7 +297,7 @@ fn render_workspace_diagnostics(context: &mut RenderContext, write: F) if errors > 0 { write( context, - "●".to_string(), + sym.to_string(), Some(context.editor.theme.get("error")), ); write(context, format!(" {} ", errors), None); diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 1708b3b4e..5550ee6b0 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -345,6 +345,7 @@ pub struct Config { /// Display diagnostic below the line they occur. pub inline_diagnostics: InlineDiagnosticsConfig, pub end_of_line_diagnostics: DiagnosticFilter, + pub diagnostics_symbol: char, } #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Eq, PartialOrd, Ord)] @@ -979,6 +980,7 @@ fn default() -> Self { jump_label_alphabet: ('a'..='z').collect(), inline_diagnostics: InlineDiagnosticsConfig::default(), end_of_line_diagnostics: DiagnosticFilter::Disable, + diagnostics_symbol: '●', } } } diff --git a/helix-view/src/gutter.rs b/helix-view/src/gutter.rs index 36f719f79..fee6e0efd 100644 --- a/helix-view/src/gutter.rs +++ b/helix-view/src/gutter.rs @@ -46,7 +46,7 @@ pub fn width(self, view: &View, doc: &Document) -> usize { } pub fn diagnostic<'doc>( - _editor: &'doc Editor, + editor: &'doc Editor, doc: &'doc Document, _view: &View, theme: &Theme, @@ -57,6 +57,7 @@ pub fn diagnostic<'doc>( let info = theme.get("info"); let hint = theme.get("hint"); let diagnostics = &doc.diagnostics; + let sym = editor.config().diagnostics_symbol; Box::new( move |line: usize, _selected: bool, first_visual_line: bool, out: &mut String| { @@ -74,7 +75,7 @@ pub fn diagnostic<'doc>( .any(|ls| ls.id() == d.provider) }); diagnostics_on_line.max_by_key(|d| d.severity).map(|d| { - write!(out, "●").ok(); + write!(out, "{}", sym).ok(); match d.severity { Some(Severity::Error) => error, Some(Severity::Warning) | None => warning,