From a43bcc876568b87f0e326612f5385d8c4922cb14 Mon Sep 17 00:00:00 2001 From: Gokul Soumya Date: Tue, 5 Jul 2022 17:54:57 +0530 Subject: Display error code only if not none --- helix-term/src/commands/lsp.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'helix-term') diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index 81e16b22..a73148cc 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -125,6 +125,7 @@ impl ui::menu::Item for PickerDiagnostic { NumberOrString::Number(n) => n.to_string(), NumberOrString::String(s) => s.to_string(), }) + .map(|code| format!(" ({})", code)) .unwrap_or_default(); let truncated_path = path::get_truncated_path(self.url.path()) @@ -135,9 +136,7 @@ impl ui::menu::Item for PickerDiagnostic { Span::raw(truncated_path), Span::raw(": "), Span::styled(&self.diag.message, style), - Span::raw(" ("), - Span::styled(code, style.add_modifier(Modifier::BOLD)), - Span::raw(")"), + Span::styled(code, style), ]) } } -- cgit v1.2.3-70-g09d2