aboutsummaryrefslogtreecommitdiff
path: root/src/term
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2017-10-12 19:07:49 -0700
committerJoe Wilm <joe@jwilm.com>2018-03-07 09:45:25 -0800
commit7298b58e74ac16d2a7a31ef7da5877f9fb54ef38 (patch)
tree34ffb8d69eca0ef6181fd3d9d5098ff13439f824 /src/term
parentd0a58c54c566e5ce1565b6ad1078439547d1cf5c (diff)
downloadalacritty-7298b58e74ac16d2a7a31ef7da5877f9fb54ef38.tar.gz
alacritty-7298b58e74ac16d2a7a31ef7da5877f9fb54ef38.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')
-rw-r--r--src/term/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs
index 00244c8a..c9e3d9b2 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};
@@ -1706,7 +1706,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);
}
@@ -1720,7 +1720,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);
}