fix: account for border when calculating message widths

This commit is contained in:
sxyazi 2026-01-26 17:22:39 +08:00
parent 92880b844b
commit adee9fb479
No known key found for this signature in database

View file

@ -40,7 +40,7 @@ impl Message {
pub fn height(&self, width: u16) -> usize {
let lines = ratatui::widgets::Paragraph::new(self.content.as_str())
.wrap(ratatui::widgets::Wrap { trim: false })
.line_count(width);
.line_count(width.saturating_sub(NOTIFY_BORDER));
lines + NOTIFY_BORDER as usize
}