Skip to content

Commit

Permalink
fix: render cells that has no content but styles
Browse files Browse the repository at this point in the history
Fix #181
  • Loading branch information
kxxt committed May 2, 2024
1 parent f1a488c commit 4efd715
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ pub fn handle<S: Screen>(term: &PseudoTerminal<S>, area: Rect, buf: &mut Buffer)
}

if let Some(screen_cell) = screen.cell(row, col) {
if screen_cell.has_contents() {
let cell = buf.get_mut(buf_col, buf_row);
screen_cell.apply(cell);
}
let cell = buf.get_mut(buf_col, buf_row);
screen_cell.apply(cell);
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/vt100_imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ impl Cell for vt100::Cell {
fn fill_buf_cell(screen_cell: &vt100::Cell, buf_cell: &mut ratatui::buffer::Cell) {
let fg = screen_cell.fgcolor();
let bg = screen_cell.bgcolor();

buf_cell.set_symbol(&screen_cell.contents());
if screen_cell.has_contents() {
buf_cell.set_symbol(&screen_cell.contents());
} else {
buf_cell.set_symbol(" ");
}
let fg: Color = fg.into();
let bg: Color = bg.into();
let mut style = Style::reset();
Expand Down

0 comments on commit 4efd715

Please sign in to comment.