ui: small bounds checking fix in view.rs

jmap
Manos Pitsidianakis 2019-11-16 20:25:05 +02:00
parent f8a1a6caa5
commit f8a2ce0bed
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 8 additions and 4 deletions

View File

@ -554,10 +554,14 @@ impl Component for MailView {
y = _y; y = _y;
} }
if archive.is_some() || post.is_some() || unsubscribe.is_some() { if archive.is_some() || post.is_some() || unsubscribe.is_some() {
grid[(x - 2, y)].set_ch(' '); if x >= 2 {
grid[(x - 1, y)].set_fg(header_fg); grid[(x - 2, y)].set_ch(' ');
grid[(x - 1, y)].set_bg(Color::Default); }
grid[(x - 1, y)].set_ch(']'); if x > 0 {
grid[(x - 1, y)].set_fg(header_fg);
grid[(x - 1, y)].set_bg(Color::Default);
grid[(x - 1, y)].set_ch(']');
}
} }
for x in x..=get_x(bottom_right) { for x in x..=get_x(bottom_right) {
grid[(x, y)].set_ch(' '); grid[(x, y)].set_ch(' ');