aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGokul Soumya2022-07-05 12:24:57 +0000
committerBlaž Hrastnik2022-07-06 11:06:46 +0000
commita43bcc876568b87f0e326612f5385d8c4922cb14 (patch)
treeed15e6ede4c7c366cef1eed695697886dc0063af
parent0c104685c024a03cd857c0adcedea55b694eb604 (diff)
Display error code only if not none
-rw-r--r--helix-term/src/commands/lsp.rs5
1 files changed, 2 insertions, 3 deletions
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),
])
}
}