From 9917ae2ac7620b9475f4a81c605bf962b033b68f Mon Sep 17 00:00:00 2001 From: James Campos Date: Tue, 14 Jul 2020 00:42:41 -0700 Subject: fix styles --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 30abdec..e1b2e13 100644 --- a/src/main.rs +++ b/src/main.rs @@ -329,7 +329,7 @@ impl View for Page { // keep attr pos >= line start let (pos, attr) = c.attrs[attr_start]; let head = (max(pos, text_start), attr); - let tail = &c.attrs[attr_start + 1..]; + let tail = &c.attrs[attr_start + 1..attr_end]; let mut attrs_iter = iter::once(&head).chain(tail.iter()).peekable(); // seems like this should be simpler. use itertools? @@ -527,7 +527,8 @@ impl Bk<'_> { while let Some(view) = self.view { let pad = self.cols.saturating_sub(self.max_width) / 2; - queue!(stdout, terminal::Clear(terminal::ClearType::All))?; + // clearing the screen doesn't reset attributes wtf + queue!(stdout, terminal::Clear(terminal::ClearType::All), Print(Attribute::Reset))?; for (i, line) in view.render(self).iter().enumerate() { queue!(stdout, cursor::MoveTo(pad, i as u16), Print(line))?; } -- cgit v1.2.3