fix(compatibility): don't drop empty lines when resizing (#148)
This commit is contained in:
parent
cbeae35f17
commit
e7ea05f50b
2 changed files with 5 additions and 1 deletions
|
|
@ -272,6 +272,9 @@ impl Grid {
|
||||||
let mut new_viewport_rows = vec![];
|
let mut new_viewport_rows = vec![];
|
||||||
for mut canonical_line in viewport_canonical_lines {
|
for mut canonical_line in viewport_canonical_lines {
|
||||||
let mut canonical_line_parts: Vec<Row> = vec![];
|
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() {
|
while !canonical_line.columns.is_empty() {
|
||||||
let next_wrap = if canonical_line.len() > new_columns {
|
let next_wrap = if canonical_line.len() > new_columns {
|
||||||
canonical_line.columns.drain(..new_columns)
|
canonical_line.columns.drain(..new_columns)
|
||||||
|
|
@ -279,7 +282,7 @@ impl Grid {
|
||||||
canonical_line.columns.drain(..)
|
canonical_line.columns.drain(..)
|
||||||
};
|
};
|
||||||
let row = Row::from_columns(next_wrap.collect());
|
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
|
// 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)
|
// 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 {
|
let row = if canonical_line_parts.is_empty() && canonical_line.is_canonical {
|
||||||
|
|
|
||||||
|
|
@ -496,6 +496,7 @@ impl vte::Perform for TerminalPane {
|
||||||
std::mem::swap(&mut self.grid, alternative_grid);
|
std::mem::swap(&mut self.grid, alternative_grid);
|
||||||
}
|
}
|
||||||
self.alternative_grid = None;
|
self.alternative_grid = None;
|
||||||
|
self.mark_for_rerender();
|
||||||
}
|
}
|
||||||
Some(&25) => {
|
Some(&25) => {
|
||||||
self.grid.hide_cursor();
|
self.grid.hide_cursor();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue