Fix image preview placement when messages are preceded by a date in the timeline (#257)

This commit is contained in:
Ethan Reynolds 2024-04-13 18:47:08 -04:00 committed by GitHub
parent 949100bdc7
commit 91ca50aecb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -961,6 +961,8 @@ impl Message {
let proto = proto.map(|p| { let proto = proto.map(|p| {
let y_off = text.lines.len() as u16; let y_off = text.lines.len() as u16;
let x_off = fmt.cols.user_gutter_width(settings); let x_off = fmt.cols.user_gutter_width(settings);
// Adjust y_off by 1 if a date was printed before the message to account for the extra line.
let y_off = if fmt.date.is_some() { y_off + 1 } else { y_off };
(p, x_off, y_off) (p, x_off, y_off)
}); });