mail/{listing,view}: fix overflow substracts

pull/260/head
Manos Pitsidianakis 2023-07-19 10:19:11 +03:00
parent 6280bc75e5
commit 2df7354751
Signed by: Manos Pitsidianakis
GPG Key ID: 7729C7707F7E09D0
2 changed files with 5 additions and 9 deletions

View File

@ -1103,7 +1103,7 @@ impl ThreadListing {
),
row_attr,
);
let (x, _) = write_string_to_grid(
write_string_to_grid(
&if self.new_cursor_pos.2.saturating_sub(top_idx) == i {
self.new_cursor_pos.2.to_string()
} else {
@ -1118,13 +1118,7 @@ impl ThreadListing {
((0, i), (width, i + 1)),
None,
);
for x in x..width {
self.data_columns.columns[0][(x, i)]
.set_ch(' ')
.set_bg(row_attr.bg)
.set_attrs(row_attr.attrs);
}
_ = write_string_to_grid(
write_string_to_grid(
&if self.new_cursor_pos.2.saturating_sub(top_idx) == i {
self.new_cursor_pos.2.to_string()
} else {

View File

@ -730,7 +730,9 @@ impl Component for EnvelopeView {
let envelope = &self.mail;
let height_p = self.pager.size().1;
let height = height!(area) - self.headers_no - 1;
let height = height!(area)
.saturating_sub(self.headers_no)
.saturating_sub(1);
self.headers_no = 0;
let mut skip_header_ctr = self.headers_cursor;