diff --git a/src/components/mail/view.rs b/src/components/mail/view.rs index 64f1988a9..5e17af1ce 100644 --- a/src/components/mail/view.rs +++ b/src/components/mail/view.rs @@ -1070,6 +1070,7 @@ impl Component for MailView { ($($string:expr)+) => { $({ if sticky || skip_header_ctr == 0 { + if y <= get_y(bottom_right) { let (_x, _y) = write_string_to_grid( &$string, grid, @@ -1079,8 +1080,9 @@ impl Component for MailView { (set_y(upper_left, y), bottom_right), Some(get_x(upper_left)), ); - clear_area(grid, ((_x, _y), (get_x(bottom_right), _y)), headers); + clear_area(grid, ((std::cmp::min(_x, get_x(bottom_right)), _y), (get_x(bottom_right), _y)), headers); y = _y + 1; + } } else { skip_header_ctr -= 1; } diff --git a/src/components/utilities.rs b/src/components/utilities.rs index b0584ff75..7d8697845 100644 --- a/src/components/utilities.rs +++ b/src/components/utilities.rs @@ -312,7 +312,7 @@ impl Component for StatusBar { get_x(upper_left), std::cmp::min( get_y(bottom_right) - height - hist_height + 1, - get_y(bottom_right), + get_y(pos_dec(bottom_right, (0, height))), ), ), pos_dec(bottom_right, (0, height)), @@ -339,7 +339,7 @@ impl Component for StatusBar { get_x(upper_left), std::cmp::min( get_y(bottom_right) - height - hist_height + 1, - get_y(bottom_right), + get_y(pos_dec(bottom_right, (0, height))), ), ), pos_dec(bottom_right, (0, height)),