Skip to content

Commit

Permalink
fix: crash on resize
Browse files Browse the repository at this point in the history
  • Loading branch information
kabouzeid committed Jul 28, 2024
1 parent edfde09 commit 96f4f16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ fn fit_text(
match l.chars().nth(cols) {
Some(_) => { // has more chars than cols
Either::Right(once(Line::default().spans(vec![
Span::raw(l.chars().take(cols - 1).collect::<String>()),
Span::raw(l.chars().take(cols.saturating_sub(1)).collect::<String>()),
Span::styled("…", Style::default().add_modifier(Modifier::DIM)),
])))
}
Expand Down

0 comments on commit 96f4f16

Please sign in to comment.