aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2018-04-21 13:37:16 +0200
committerJoe Wilm <jwilm@users.noreply.github.com>2018-04-24 10:01:33 -0700
commit2b3ef5f6644fcefe595a52846744662bd99c2f6d (patch)
treeeb7fef77676a4a22c494a18b4887b46ef32987ab
parentadf4b625e42d76bef3758783ba22c2d1cc2d2901 (diff)
downloadalacritty-2b3ef5f6644fcefe595a52846744662bd99c2f6d.tar.gz
alacritty-2b3ef5f6644fcefe595a52846744662bd99c2f6d.zip
Revert "Fix cursor not showing in first column"
This reverts commit 54b21b66ecc6f8f149d1425567e0e3d766a3ac54.
-rw-r--r--src/grid/mod.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/grid/mod.rs b/src/grid/mod.rs
index bc288e3b..c05584c4 100644
--- a/src/grid/mod.rs
+++ b/src/grid/mod.rs
@@ -745,16 +745,15 @@ impl<'a, T: Copy + 'a> Iterator for DisplayIter<'a, T> {
#[inline]
fn next(&mut self) -> Option<Self::Item> {
- // Check if the end of the line was reached
- let next_line = self.col == self.grid.num_cols();
- if next_line {
- // Return `None` if we've reached the end of the last line
+ // 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));
}
@@ -766,10 +765,7 @@ impl<'a, T: Copy + 'a> Iterator for DisplayIter<'a, T> {
column: self.col
});
- // Only increment column if the line hasn't changed
- if !next_line {
- self.col += 1;
- }
+ self.col += 1;
item
}
}