Skip to content

Commit

Permalink
Fix unix implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
gwenn committed Aug 25, 2024
1 parent bb68c72 commit 77e7b70
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/tty/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1011,10 +1011,15 @@ impl Renderer for PosixRenderer {
.push_str(&highlighter.highlight(line, line.pos()));
} else {
use crate::highlight::Style;
for (style, block) in highlighter.highlight_line(line, line.pos()) {
write!(self.buffer, "{}", style.start())?;
self.buffer.push_str(&block);
write!(self.buffer, "{}", style.end())?;
let it = highlighter.highlight_line(line, line.pos());
if it.len() == 0 {
self.buffer.push_str(line);
} else {
for (style, block) in it {
write!(self.buffer, "{}", style.start())?;
self.buffer.push_str(&block);
write!(self.buffer, "{}", style.end())?;
}
}
}
}
Expand Down

0 comments on commit 77e7b70

Please sign in to comment.