mirror of
https://github.com/alacritty/alacritty.git
synced 2025-02-17 15:57:08 -05:00
Implement clearing above cursor
This commit is contained in:
parent
098eca8d10
commit
1852707af3
1 changed files with 14 additions and 2 deletions
|
@ -1137,8 +1137,20 @@ impl ansi::Handler for Term {
|
||||||
ansi::ClearMode::All => {
|
ansi::ClearMode::All => {
|
||||||
self.grid.clear(|c| c.reset(&template));
|
self.grid.clear(|c| c.reset(&template));
|
||||||
},
|
},
|
||||||
_ => {
|
ansi::ClearMode::Above => {
|
||||||
trace!("ansi::ClearMode::Above not implemented");
|
// If clearing more than one line
|
||||||
|
if self.cursor.point.line > Line(1) {
|
||||||
|
// Fully clear all lines before the current line
|
||||||
|
for row in &mut self.grid[..self.cursor.point.line] {
|
||||||
|
for cell in row {
|
||||||
|
cell.reset(&template);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Clear up to the current column in the current line
|
||||||
|
for cell in &mut self.grid[self.cursor.point.line][..self.cursor.point.col] {
|
||||||
|
cell.reset(&template);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue