Skip to content

Commit

Permalink
fix: hide incomplete lines in log files
Browse files Browse the repository at this point in the history
  • Loading branch information
kabouzeid committed Mar 28, 2023
1 parent 67e24e0 commit 28eb452
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ impl App {
}

fn string_for_paragraph(s: &str, lines: usize, cols: usize, offset: usize) -> String {
let s = s.rsplit_once(&['\r', '\n']).map_or(s, |(p, _)| p); // skip everything after last line delimiter
s.lines()
.flat_map(|l| l.split('\r')) // bandaid for term escape codes
.rev()
Expand Down

0 comments on commit 28eb452

Please sign in to comment.