Skip to content

Commit

Permalink
Fix 'attempt to divide by zero' panic (#6155)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuid64 committed Mar 3, 2023
1 parent 6e7dcb3 commit ddc5bf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helix-term/src/ui/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub fn required_size(text: &tui::text::Text, max_text_width: u16) -> (u16, u16)
let content_width = content.width() as u16;
if content_width > max_text_width {
text_width = max_text_width;
height += content_width / max_text_width;
height += content_width.checked_div(max_text_width).unwrap_or(0);
} else if content_width > text_width {
text_width = content_width;
}
Expand Down

0 comments on commit ddc5bf4

Please sign in to comment.