mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 17:36:19 +04:00
Fix 'attempt to divide by zero' panic (#6155)
This commit is contained in:
parent
6e7dcb3317
commit
ddc5bf4e60
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user