mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00: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
1 changed files with 6 additions and 2 deletions
|
|
@ -36,7 +36,11 @@ impl Message {
|
||||||
return 0; // In case we can't get the width of the terminal
|
return 0; // In case we can't get the width of the terminal
|
||||||
}
|
}
|
||||||
|
|
||||||
let lines = (self.content.width() as f64 / width as f64).ceil();
|
let mut lines = 0;
|
||||||
lines as usize + NOTIFY_BORDER as usize
|
for line in self.content.lines() {
|
||||||
|
lines += (line.width() + 1).div_ceil(width as usize)
|
||||||
|
}
|
||||||
|
|
||||||
|
lines + NOTIFY_BORDER as usize
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue