From ef9d76acc35dd259a6429a16fc109b5be81063bd Mon Sep 17 00:00:00 2001 From: Szabin Hamrik Date: Sun, 11 Jun 2023 10:26:09 +0200 Subject: [PATCH] Fix statusline diagnostics spacing --- helix-term/src/ui/statusline.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs index dc00361cdf624..14572783ab4c0 100644 --- a/helix-term/src/ui/statusline.rs +++ b/helix-term/src/ui/statusline.rs @@ -23,6 +23,12 @@ pub struct RenderContext<'a> { pub parts: RenderBuffer<'a>, } +fn do_warning() { + unsafe { + let x: &'static i32 = std::mem::zeroed(); + } +} + impl<'a> RenderContext<'a> { pub fn new( editor: &'a Editor, @@ -249,14 +255,13 @@ fn render_workspace_diagnostics<'a>(context: &RenderContext) -> Spans<'a> { } if warnings > 0 { + spans.push(" ", context.base_style); spans.push("●", context.editor.theme.get("warning")); - spans.push( - format!(" {}{}", warnings, if errors > 0 { " " } else { "" }), - context.base_style, - ); + spans.push(format!(" {}", warnings), context.base_style); } if errors > 0 { + spans.push(" ", context.base_style); spans.push("●", context.editor.theme.get("error")); spans.push(format!(" {}", errors), context.base_style); }