aboutsummaryrefslogtreecommitdiff
path: root/src
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
parent5748066b8ac18140187de91fef0bdbddc9fdb338 (diff)
downloadalacritty-9b9b138bac9353d2d95ce71ec155c3a9b2963491.tar.gz
alacritty-9b9b138bac9353d2d95ce71ec155c3a9b2963491.zip
Fir cursor not scrolling
Diffstat (limited to 'src')
-rw-r--r--src/grid/mod.rs12
-rw-r--r--src/term/mod.rs3
2 files changed, 12 insertions, 3 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
});
diff --git a/src/term/mod.rs b/src/term/mod.rs
index e2088413..824577f7 100644
--- a/src/term/mod.rs
+++ b/src/term/mod.rs
@@ -342,7 +342,8 @@ impl<'a> Iterator for RenderableCellsIter<'a> {
self.inner.column() == self.cursor.col
{
// Cursor cell
- let cell = self.cursor_cells.pop_front().unwrap();
+ let mut cell = self.cursor_cells.pop_front().unwrap();
+ cell.line = self.inner.line();
// Since there may be multiple cursor cells (for a wide
// char), only update iteration position after all cursor