Handle newlines in register infobox

This commit is contained in:
Gokul Soumya 2022-02-05 12:05:51 +05:30 committed by Blaž Hrastnik
parent bf773db451
commit fa83426011

View File

@ -58,7 +58,12 @@ pub fn from_registers(registers: &Registers) -> Self {
.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();