mirror of
https://github.com/sxyazi/yazi.git
synced 2024-12-19 06:41:35 +03:00
fix: adjust calculation for number of lines in a notification message (#828)
Co-authored-by: sxyazi <sxyazi@gmail.com>
This commit is contained in:
parent
955e8f59a9
commit
9918ceb7f4
@ -36,7 +36,11 @@ impl Message {
|
||||
return 0; // In case we can't get the width of the terminal
|
||||
}
|
||||
|
||||
let lines = (self.content.width() as f64 / width as f64).ceil();
|
||||
lines as usize + NOTIFY_BORDER as usize
|
||||
let mut lines = 0;
|
||||
for line in self.content.lines() {
|
||||
lines += (line.width() + 1).div_ceil(width as usize)
|
||||
}
|
||||
|
||||
lines + NOTIFY_BORDER as usize
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user