diff options
| author | Aram Drevekenin <aram@poor.dev> | 2021-01-19 18:34:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-19 18:34:53 +0100 |
| commit | e7ea05f50bcb19342639ce231638f71eca768f70 (patch) | |
| tree | 982deedbf4a6c55ddac05d0272619fd288de19b6 /src | |
| parent | Update GOVERNANCE.md (diff) | |
| download | sl0ppij-e7ea05f50bcb19342639ce231638f71eca768f70.tar.gz sl0ppij-e7ea05f50bcb19342639ce231638f71eca768f70.tar.xz sl0ppij-e7ea05f50bcb19342639ce231638f71eca768f70.zip | |
fix(compatibility): don't drop empty lines when resizing (#148)
Diffstat (limited to 'src')
| -rw-r--r-- | src/panes/grid.rs | 5 | ||||
| -rw-r--r-- | src/panes/terminal_pane.rs | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/panes/grid.rs b/src/panes/grid.rs index 3d0f220b..754433d2 100644 --- a/src/panes/grid.rs +++ b/src/panes/grid.rs @@ -272,6 +272,9 @@ 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) @@ -279,7 +282,7 @@ impl Grid { 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 { diff --git a/src/panes/terminal_pane.rs b/src/panes/terminal_pane.rs index 3ad60050..466f5b65 100644 --- a/src/panes/terminal_pane.rs +++ b/src/panes/terminal_pane.rs @@ -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(); |
