don't explode when scrolling back

This commit is contained in:
Wez Furlong committed 2018-02-18 23:04:11 -08:00
1 parent e87f129ded
commit 450ed0e82c
2 files changed
+7 -2

No files matched your search

+2 -2
View File
@@ -552,8 +552,8 @@ impl<'a> TerminalWindow<'a> {
let mut verts = Vec::new();
let mut indices = Vec::new();
let num_cols = ((width + 1.0) / cell_width).floor() as usize;
let num_rows = ((height + 1.0) / cell_height).floor() as usize;
let num_cols = (width as usize + 1) / cell_width as usize;
let num_rows = (height as usize + 1) / cell_height as usize;
for y in 0..num_rows {
for x in 0..num_cols {
+5
View File
@@ -650,6 +650,11 @@ impl TerminalState {
let selection = self.selection_range.map(|r| r.normalize());
for (i, mut line) in screen.lines.iter().skip(len - height).enumerate() {
if i >= height {
// When scrolling back, make sure we don't emit lines that
// are below the bottom of the viewport
break;
}
if line.is_dirty() {
let selrange = match selection {
None => 0..0,