diff options
Diffstat (limited to 'src/term/mod.rs')
-rw-r--r-- | src/term/mod.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs index eab73e74..45dd8a45 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -306,7 +306,7 @@ impl Term { mode: Default::default(), scroll_region: scroll_region, size_info: size, - template_cell: template.clone(), + template_cell: template, empty_cell: template, } } @@ -498,7 +498,7 @@ impl Term { println!("num_cols, num_lines = {}, {}", num_cols, num_lines); // Resize grids to new size - let template = self.template_cell.clone(); + let template = self.template_cell; self.grid.resize(num_lines, num_cols, &template); self.alt_grid.resize(num_lines, num_cols, &template); @@ -514,7 +514,7 @@ impl Term { self.tabs[0] = false; // Make sure bottom of terminal is clear - let template = self.empty_cell.clone(); + let template = self.empty_cell; self.grid.clear_region((self.cursor.line).., |c| c.reset(&template)); self.alt_grid.clear_region((self.cursor.line).., |c| c.reset(&template)); @@ -538,7 +538,7 @@ impl Term { ::std::mem::swap(&mut self.cursor, &mut self.alt_cursor); if self.alt { - let template = self.empty_cell.clone(); + let template = self.empty_cell; self.grid.clear(|c| c.reset(&template)); } } @@ -551,7 +551,7 @@ impl Term { debug_println!("scroll_down: {}", lines); // Copy of cell template; can't have it borrowed when calling clear/scroll - let template = self.empty_cell.clone(); + let template = self.empty_cell; // Clear `lines` lines at bottom of area { @@ -576,7 +576,7 @@ impl Term { debug_println!("scroll_up: {}", lines); // Copy of cell template; can't have it borrowed when calling clear/scroll - let template = self.empty_cell.clone(); + let template = self.empty_cell; // Clear `lines` lines starting from origin to origin + lines { @@ -636,7 +636,7 @@ impl ansi::Handler for Term { } let cell = &mut self.grid[&self.cursor]; - *cell = self.template_cell.clone(); + *cell = self.template_cell; cell.c = c; self.cursor.col += 1; } @@ -682,7 +682,7 @@ impl ansi::Handler for Term { // Cells were just moved out towards the end of the line; fill in // between source and dest with blanks. - let template = self.empty_cell.clone(); + let template = self.empty_cell; for c in &mut line[source..destination] { c.reset(&template); } @@ -834,7 +834,7 @@ impl ansi::Handler for Term { let end = start + count; let row = &mut self.grid[self.cursor.line]; - let template = self.empty_cell.clone(); + let template = self.empty_cell; for c in &mut row[start..end] { c.reset(&template); } @@ -861,7 +861,7 @@ impl ansi::Handler for Term { // Clear last `count` cells in line. If deleting 1 char, need to delete // 1 cell. - let template = self.empty_cell.clone(); + let template = self.empty_cell; let end = self.size_info.cols() - count; for c in &mut line[end..] { c.reset(&template); @@ -891,7 +891,7 @@ impl ansi::Handler for Term { #[inline] fn clear_line(&mut self, mode: ansi::LineClearMode) { debug_println!("clear_line: {:?}", mode); - let template = self.empty_cell.clone(); + let template = self.empty_cell; match mode { ansi::LineClearMode::Right => { let row = &mut self.grid[self.cursor.line]; @@ -917,7 +917,7 @@ impl ansi::Handler for Term { #[inline] fn clear_screen(&mut self, mode: ansi::ClearMode) { debug_println!("clear_screen: {:?}", mode); - let template = self.empty_cell.clone(); + let template = self.empty_cell; match mode { ansi::ClearMode::Below => { for row in &mut self.grid[self.cursor.line..] { |