From fa83426011fa80351502fdfc863376248c6ffcbb Mon Sep 17 00:00:00 2001 From: Gokul Soumya Date: Sat, 5 Feb 2022 12:05:51 +0530 Subject: Handle newlines in register infobox --- helix-view/src/info.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'helix-view') diff --git a/helix-view/src/info.rs b/helix-view/src/info.rs index fbe27ea0..5ad6a60c 100644 --- a/helix-view/src/info.rs +++ b/helix-view/src/info.rs @@ -58,7 +58,12 @@ impl Info { .inner() .iter() .map(|(ch, reg)| { - let content = reg.read().join(", ").trim_end().to_string(); + let content = reg + .read() + .get(0) + .and_then(|s| s.lines().next()) + .map(String::from) + .unwrap_or_default(); (ch.to_string(), content) }) .collect(); -- cgit v1.2.3-70-g09d2