Skip to content

Commit 9917ae2

Browse files
committed
fix styles
1 parent 249d438 commit 9917ae2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ impl View for Page {
329329
// keep attr pos >= line start
330330
let (pos, attr) = c.attrs[attr_start];
331331
let head = (max(pos, text_start), attr);
332-
let tail = &c.attrs[attr_start + 1..];
332+
let tail = &c.attrs[attr_start + 1..attr_end];
333333
let mut attrs_iter = iter::once(&head).chain(tail.iter()).peekable();
334334

335335
// seems like this should be simpler. use itertools?
@@ -527,7 +527,8 @@ impl Bk<'_> {
527527
while let Some(view) = self.view {
528528
let pad = self.cols.saturating_sub(self.max_width) / 2;
529529

530-
queue!(stdout, terminal::Clear(terminal::ClearType::All))?;
530+
// clearing the screen doesn't reset attributes wtf
531+
queue!(stdout, terminal::Clear(terminal::ClearType::All), Print(Attribute::Reset))?;
531532
for (i, line) in view.render(self).iter().enumerate() {
532533
queue!(stdout, cursor::MoveTo(pad, i as u16), Print(line))?;
533534
}

0 commit comments

Comments
 (0)