Skip to content

Commit

Permalink
add check if not on bottom of terminal (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
nithinmuthukumar authored Jan 7, 2024
1 parent 33f3a67 commit de4b22d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/shrs_line/src/painter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ impl Painter {
.max(styled_buf_lines.len() - 1 + prompt_left_lines.len() - 1);

//make sure num_newlines never gets smaller, and adds newlines to adjust for prompt
if self.num_newlines < total_newlines {
if self.num_newlines < total_newlines
&& cursor::position()?.1 + self.num_newlines as u16 == self.term_size.1 - 1
{
self.out
.borrow_mut()
.queue(ScrollUp((total_newlines - self.num_newlines) as u16))?;
Expand Down

0 comments on commit de4b22d

Please sign in to comment.