Skip to content

Commit

Permalink
avoid negative repeat_count fixes dandavison#1760
Browse files Browse the repository at this point in the history
  • Loading branch information
lrfurtado committed Jul 18, 2024
1 parent 5d538b2 commit 1e3e9bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/paint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ impl<'p> Painter<'p> {
line.push_str(
#[allow(clippy::unnecessary_to_owned)]
&fill_style
.paint(" ".repeat(config.available_terminal_width - text_width))
.paint(
" ".repeat(config.available_terminal_width.saturating_sub(text_width)),
)
.to_string(),
);
} else if line_is_empty {
Expand Down

0 comments on commit 1e3e9bc

Please sign in to comment.