mirror of
https://github.com/zellij-org/zellij.git
synced 2024-12-25 10:15:09 +03:00
fix(stability): do not clear line if it's not there (#289)
* fix(stability): do not clear line if it's not there * style(fmt): rustfmt
This commit is contained in:
parent
76080d3229
commit
fc2110ab68
@ -606,9 +606,10 @@ impl Grid {
|
|||||||
row.replace_beginning_with(line_part);
|
row.replace_beginning_with(line_part);
|
||||||
}
|
}
|
||||||
pub fn clear_all_after_cursor(&mut self, replace_with: TerminalCharacter) {
|
pub fn clear_all_after_cursor(&mut self, replace_with: TerminalCharacter) {
|
||||||
let cursor_row = self.viewport.get_mut(self.cursor.y).unwrap();
|
if let Some(cursor_row) = self.viewport.get_mut(self.cursor.y).as_mut() {
|
||||||
cursor_row.truncate(self.cursor.x);
|
cursor_row.truncate(self.cursor.x);
|
||||||
let mut replace_with_columns_in_cursor_row = vec![replace_with; self.width - self.cursor.x];
|
let mut replace_with_columns_in_cursor_row =
|
||||||
|
vec![replace_with; self.width - self.cursor.x];
|
||||||
cursor_row.append(&mut replace_with_columns_in_cursor_row);
|
cursor_row.append(&mut replace_with_columns_in_cursor_row);
|
||||||
|
|
||||||
let replace_with_columns = vec![replace_with; self.width];
|
let replace_with_columns = vec![replace_with; self.width];
|
||||||
@ -617,6 +618,7 @@ impl Grid {
|
|||||||
row.replace_columns(replace_with_columns.clone());
|
row.replace_columns(replace_with_columns.clone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
pub fn clear_cursor_line(&mut self) {
|
pub fn clear_cursor_line(&mut self) {
|
||||||
self.viewport.get_mut(self.cursor.y).unwrap().truncate(0);
|
self.viewport.get_mut(self.cursor.y).unwrap().truncate(0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user