view/envelope: fix some out of bounds drawing.
Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (push) Successful in 9m31s Details

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
pull/301/head
Manos Pitsidianakis 2023-09-09 12:54:59 +03:00
parent 45d4f611b1
commit 7e4ed2fa10
Signed by: Manos Pitsidianakis
GPG Key ID: 7729C7707F7E09D0
1 changed files with 9 additions and 6 deletions

View File

@ -960,14 +960,17 @@ impl Component for EnvelopeView {
}
if archive.is_some() || post.is_some() || unsubscribe.is_some() {
if x >= 2 {
grid[(x - 2, y)].set_ch(' ');
if let Some(cell) = grid.get_mut(x - 2, y) {
cell.set_ch(' ');
}
}
if x > 0 {
grid[(x - 1, y)]
.set_ch(']')
.set_fg(headers_names.fg)
.set_bg(headers_names.bg)
.set_attrs(headers_names.attrs);
if let Some(cell) = grid.get_mut(x - 1, y) {
cell.set_ch(']')
.set_fg(headers_names.fg)
.set_bg(headers_names.bg)
.set_attrs(headers_names.attrs);
}
}
}
for x in x..=get_x(bottom_right) {