Skip to content

Commit

Permalink
Handle newlines in register infobox
Browse files Browse the repository at this point in the history
  • Loading branch information
sudormrfbin committed Feb 5, 2022
1 parent 46b5510 commit dbdb645
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion helix-view/src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit dbdb645

Please sign in to comment.