summaryrefslogtreecommitdiff
path: root/src/grid
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2018-02-15 19:34:09 -0800
committerJoe Wilm <joe@jwilm.com>2018-06-02 09:32:29 -0700
commit9b9b138bac9353d2d95ce71ec155c3a9b2963491 (patch)
tree9bf92776812ae92193beaad7bcd773eaeee42b08 /src/grid
parent5748066b8ac18140187de91fef0bdbddc9fdb338 (diff)
downloadalacritty-9b9b138bac9353d2d95ce71ec155c3a9b2963491.tar.gz
alacritty-9b9b138bac9353d2d95ce71ec155c3a9b2963491.zip
Fir cursor not scrolling
Diffstat (limited to 'src/grid')
-rw-r--r--src/grid/mod.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/grid/mod.rs b/src/grid/mod.rs
index 749012fa..1889d59f 100644
--- a/src/grid/mod.rs
+++ b/src/grid/mod.rs
@@ -628,6 +628,7 @@ pub struct DisplayIter<'a, T: 'a> {
offset: usize,
limit: usize,
col: Column,
+ line: Line,
}
impl<'a, T: 'a> DisplayIter<'a, T> {
@@ -635,8 +636,9 @@ impl<'a, T: 'a> DisplayIter<'a, T> {
let offset = grid.display_offset + *grid.num_lines() - 1;
let limit = grid.display_offset;
let col = Column(0);
+ let line = Line(0);
- DisplayIter { grid, offset, col, limit }
+ DisplayIter { grid, offset, col, limit, line }
}
pub fn offset(&self) -> usize {
@@ -646,6 +648,10 @@ impl<'a, T: 'a> DisplayIter<'a, T> {
pub fn column(&self) -> Column {
self.col
}
+
+ pub fn line(&self) -> Line {
+ self.line
+ }
}
impl<'a, T: Copy + 'a> Iterator for DisplayIter<'a, T> {
@@ -660,13 +666,15 @@ impl<'a, T: Copy + 'a> Iterator for DisplayIter<'a, T> {
}
self.col = Column(0);
+
self.offset -= 1;
+ self.line = Line(*self.grid.lines - 1 - (self.offset - self.limit));
}
// Return the next item.
let item = Some(Indexed {
inner: self.grid.raw[self.offset][self.col],
- line: Line( *self.grid.lines - 1 - (self.offset - self.limit)),
+ line: self.line,
column: self.col
});