aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Campos <james.r.campos@gmail.com>2020-07-14 00:42:41 -0700
committerJames Campos <james.r.campos@gmail.com>2020-07-14 00:42:41 -0700
commit9917ae2ac7620b9475f4a81c605bf962b033b68f (patch)
treef71415044f91446e2faa49d83e2a93cfe8387a0c /src
parent249d438b8fa9e72da44c40d5f2fff0b8d3cc768c (diff)
downloadbk-9917ae2ac7620b9475f4a81c605bf962b033b68f.tar.gz
fix styles
Diffstat (limited to 'src')
-rw-r--r--src/main.rs5
1 files 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))?;
}