diff options
author | Joe Wilm <joe@jwilm.com> | 2017-10-12 19:07:49 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2018-06-02 09:24:38 -0700 |
commit | bbe276e3a80571dd0d72a9b32fb7bed38c3be868 (patch) | |
tree | 122b3412c00aeab21ab14043a961f95f45c78715 /src/term/mod.rs | |
parent | fd7c1bf6639afc2a141a215f6f64fa299c5a160e (diff) | |
download | alacritty-bbe276e3a80571dd0d72a9b32fb7bed38c3be868.tar.gz alacritty-bbe276e3a80571dd0d72a9b32fb7bed38c3be868.zip |
Back Grid with VecDeque
VecDeque offers improved performance beyond a plain Vec for common
scrolling situations (full screen scroll). Additionally, VecDeque is
necessary for performant scrollback since recycling old rows for a Vec
would be expensive (push/pop front would shift entire vec).
Diffstat (limited to 'src/term/mod.rs')
-rw-r--r-- | src/term/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs index 4f56e7fc..dd853368 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -24,7 +24,7 @@ use unicode_width::UnicodeWidthChar; use font::{self, Size}; use ansi::{self, Color, NamedColor, Attr, Handler, CharsetIndex, StandardCharset, CursorStyle}; -use grid::{BidirectionalIterator, Grid, ClearRegion, ToRange, Indexed}; +use grid::{BidirectionalIterator, Grid, ClearRegion, ToRange, Indexed, IndexRegion}; use index::{self, Point, Column, Line, Linear, IndexRange, Contains, RangeInclusive}; use selection::{self, Span, Selection}; use config::{Config, VisualBellAnimation}; @@ -1708,7 +1708,7 @@ impl ansi::Handler for Term { cell.reset(&template); } if self.cursor.point.line < self.grid.num_lines() - 1 { - for row in &mut self.grid[(self.cursor.point.line + 1)..] { + for row in self.grid.region_mut((self.cursor.point.line + 1)..) { for cell in row { cell.reset(&template); } @@ -1722,7 +1722,7 @@ impl ansi::Handler for Term { // 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 row in self.grid.region_mut(..self.cursor.point.line) { for cell in row { cell.reset(&template); } |