From 81621856e23c4b4ad93f2032c72803c18b3b575c Mon Sep 17 00:00:00 2001 From: Ben Fiedler Date: Tue, 23 Mar 2021 18:12:22 +0100 Subject: [PATCH] Do not enclose plaintext in ``` on hover When working with larger multiple plaintext outputs, enclosing each output in ``` hinders readability. --- src/types.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/types.rs b/src/types.rs index 1eb39548d..0cc69772e 100644 --- a/src/types.rs +++ b/src/types.rs @@ -807,9 +807,15 @@ impl ToDisplay for Hover { if let MarkedString::LanguageString(ref ls) = ms { let mut buf = Vec::new(); - buf.push(format!("```{}", ls.language)); + if ls.language != "plaintext" { + buf.push(format!("```{}", ls.language)); + } + buf.extend(ls.value.lines().map(String::from)); - buf.push("```".to_string()); + + if ls.language != "plaintext" { + buf.push("```".to_string()); + } buf } else {