Compare commits
No commits in common. "922ba9c524008eaa8003e07b2043cc405dbbc6f0" and "14c6db57694d8f88dfe89f135b9eed3af8a9d75f" have entirely different histories.
922ba9c524
...
14c6db5769
10
src/tile.rs
10
src/tile.rs
|
@ -289,7 +289,7 @@ impl Tile {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Autoscroll whene content arrives on stdout
|
// Autoscroll whene content arrives on stdout
|
||||||
self.scroll = self.stdout.len() as isize - 2 - (self.inner_size.1 as isize);
|
self.scroll = self.stdout.len() as isize - 1 - (self.inner_size.1 as isize);
|
||||||
if self.scroll < 0 {
|
if self.scroll < 0 {
|
||||||
self.scroll = 0;
|
self.scroll = 0;
|
||||||
}
|
}
|
||||||
|
@ -448,6 +448,8 @@ impl Tile {
|
||||||
}
|
}
|
||||||
buffer.push(spaces);
|
buffer.push(spaces);
|
||||||
|
|
||||||
|
eprintln!("Clear {}", max_char_index);
|
||||||
|
|
||||||
line_index += 1;
|
line_index += 1;
|
||||||
current_char_index = 0;
|
current_char_index = 0;
|
||||||
max_char_index = 0;
|
max_char_index = 0;
|
||||||
|
@ -497,7 +499,6 @@ impl Tile {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if last_line_index <= h {
|
|
||||||
let mut spaces = format!(
|
let mut spaces = format!(
|
||||||
"{}",
|
"{}",
|
||||||
cursor::Goto(x + max_char_index, y + last_line_index as u16 - scroll)
|
cursor::Goto(x + max_char_index, y + last_line_index as u16 - scroll)
|
||||||
|
@ -507,7 +508,6 @@ impl Tile {
|
||||||
spaces.push(DELETE_CHAR);
|
spaces.push(DELETE_CHAR);
|
||||||
}
|
}
|
||||||
buffer.push(spaces);
|
buffer.push(spaces);
|
||||||
}
|
|
||||||
|
|
||||||
buffer.push(format!("{}", style::Reset));
|
buffer.push(format!("{}", style::Reset));
|
||||||
buffer.join("")
|
buffer.join("")
|
||||||
|
@ -522,7 +522,7 @@ impl Tile {
|
||||||
|
|
||||||
/// Scrolls down one line.
|
/// Scrolls down one line.
|
||||||
pub fn scroll_down(&mut self) {
|
pub fn scroll_down(&mut self) {
|
||||||
if self.scroll + (self.inner_size.1 as isize) < self.stdout.len() as isize - 2 {
|
if self.scroll + (self.inner_size.1 as isize) < self.stdout.len() as isize - 1 {
|
||||||
self.scroll += 1;
|
self.scroll += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -534,7 +534,7 @@ impl Tile {
|
||||||
|
|
||||||
/// Scrolls down one line.
|
/// Scrolls down one line.
|
||||||
pub fn scroll_full_down(&mut self) {
|
pub fn scroll_full_down(&mut self) {
|
||||||
self.scroll = self.stdout.len() as isize - self.inner_size.1 as isize - 2;
|
self.scroll = self.stdout.len() as isize - self.inner_size.1 as isize - 1;
|
||||||
if self.scroll < 0 {
|
if self.scroll < 0 {
|
||||||
self.scroll = 0;
|
self.scroll = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue