diff options
author | Gokul Soumya | 2022-02-05 06:35:51 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2022-02-10 01:52:06 +0000 |
commit | fa83426011fa80351502fdfc863376248c6ffcbb (patch) | |
tree | 0a844e2890eb258c3a825b32bda167f81c52f625 | |
parent | bf773db45171b59a758b7dabf9f10ffb8852dcf0 (diff) |
Handle newlines in register infobox
-rw-r--r-- | helix-view/src/info.rs | 7 |
1 files changed, 6 insertions, 1 deletions
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(); |