Skip to content

Commit

Permalink
fix(compatibility): don't drop empty lines when resizing (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
imsnif authored Jan 19, 2021
1 parent cbeae35 commit e7ea05f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/panes/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,17 @@ impl Grid {
let mut new_viewport_rows = vec![];
for mut canonical_line in viewport_canonical_lines {
let mut canonical_line_parts: Vec<Row> = vec![];
if canonical_line.columns.is_empty() {
canonical_line_parts.push(Row::new().canonical());
}
while !canonical_line.columns.is_empty() {
let next_wrap = if canonical_line.len() > new_columns {
canonical_line.columns.drain(..new_columns)
} else {
canonical_line.columns.drain(..)
};
let row = Row::from_columns(next_wrap.collect());
// if there are no more parts, this row is canonical as long as it originall
// if there are no more parts, this row is canonical as long as it originally
// was canonical (it might not have been for example if it's the first row in
// the viewport, and the actual canonical row is above it in the scrollback)
let row = if canonical_line_parts.is_empty() && canonical_line.is_canonical {
Expand Down
1 change: 1 addition & 0 deletions src/panes/terminal_pane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ impl vte::Perform for TerminalPane {
std::mem::swap(&mut self.grid, alternative_grid);
}
self.alternative_grid = None;
self.mark_for_rerender();
}
Some(&25) => {
self.grid.hide_cursor();
Expand Down

0 comments on commit e7ea05f

Please sign in to comment.