fix: account for border when calculating message widths (#3615)

This commit is contained in:
三咲雅 misaki masa 2026-01-26 17:23:57 +08:00 committed by GitHub
parent 92880b844b
commit 06c665a086
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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
}