aboutsummaryrefslogtreecommitdiff
path: root/src/grid
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2018-04-21 13:45:43 +0200
committerJoe Wilm <joe@jwilm.com>2018-06-02 09:56:50 -0700
commitbfa926555145f9f578430b87bc1c1b72ef80589f (patch)
tree5ac7e445d51686acbb6eb794c56ef4849cf53556 /src/grid
parent4df09128ced0db31e26f3d26c67ffc658475bffb (diff)
downloadalacritty-bfa926555145f9f578430b87bc1c1b72ef80589f.tar.gz
alacritty-bfa926555145f9f578430b87bc1c1b72ef80589f.zip
Fix bright characters in first column
This bug was introduced by the commit which fixed the invisible cursor in the first column (54b21b66ecc6f8f149d1425567e0e3d766a3ac54). To resolve this the alternative implementation by @jwilm has been applied which seems to work out. This fixes #1259.
Diffstat (limited to 'src/grid')
-rw-r--r--src/grid/mod.rs26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/grid/mod.rs b/src/grid/mod.rs
index c05584c4..313973a3 100644
--- a/src/grid/mod.rs
+++ b/src/grid/mod.rs
@@ -745,27 +745,29 @@ impl<'a, T: Copy + 'a> Iterator for DisplayIter<'a, T> {
#[inline]
fn next(&mut self) -> Option<Self::Item> {
- // Make sure indices are valid. Return None if we've reached the end.
- if self.col == self.grid.num_cols() {
- if self.offset == self.limit {
- return None;
- }
-
- // Switch to the next line
- self.col = Column(0);
-
- self.offset -= 1;
- self.line = Line(*self.grid.lines - 1 - (self.offset - self.limit));
+ // Return None if we've reached the end.
+ if self.offset == self.limit && self.grid.num_cols() == self.col {
+ return None;
}
- // Return the next item
+ // Get the next item.
let item = Some(Indexed {
inner: self.grid.raw[self.offset][self.col],
line: self.line,
column: self.col
});
+ // Update line/col to point to next item
self.col += 1;
+ if self.col == self.grid.num_cols() {
+ if self.offset != self.limit {
+ self.offset -= 1;
+
+ self.col = Column(0);
+ self.line = Line(*self.grid.lines - 1 - (self.offset - self.limit));
+ }
+ }
+
item
}
}