Skip to content

Commit

Permalink
Remove scroll following
Browse files Browse the repository at this point in the history
  • Loading branch information
9999years committed Mar 1, 2024
1 parent 1678c29 commit be6b7a8
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/tui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,10 @@ impl Tui {
self.scroll_offset = min(self.scroll_max(), scroll_offset);
}

fn maybe_follow(&mut self) {
let height = self.size().height as usize;
if self.scroll_offset >= self.line_count - height - 1 {
self.scroll_offset += 1;
}
}

fn push_line(&mut self, line: String) {
self.scrollback.extend(line.into_bytes());
self.scrollback.push(b'\n');
self.line_count += 1;
self.maybe_follow();
}

#[instrument(level = "trace", skip(self))]
Expand Down

0 comments on commit be6b7a8

Please sign in to comment.