on master help sign in
Handle newlines in register infobox
commitfa83426011fa80351502fdfc863376248c6ffcbb authorGokul Soumya <gokulps15@gmail.com> dateSat 5 Feb 2022, 12:05 (5 years ago) parentbf773db
1 file changed+6−1
helix-view/src/info.rs+6−1
helix-view/src/info.rs+6−1
@@ -58,7 +58,12 @@ impl Info {
5858 .inner()
5959 .iter()
6060 .map(|(ch, reg)| {
61− let content = reg.read().join(", ").trim_end().to_string();
61+ let content = reg
62+ .read()
63+ .get(0)
64+ .and_then(|s| s.lines().next())
65+ .map(String::from)
66+ .unwrap_or_default();
6267 (ch.to_string(), content)
6368 })
6469 .collect();