Skip to content

Commit

Permalink
Doesn't execute the SoftClear command if already at the top of panel
Browse files Browse the repository at this point in the history
  • Loading branch information
fcoury committed Mar 9, 2023
1 parent 8273905 commit 48d38c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions zellij-server/src/panes/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,9 @@ impl Grid {
}
}
pub fn roll_to_top(&mut self) {
if self.cursor.y == 0 {
return;
}
let additional_lines = self.height - self.cursor.y - 1;
for _ in 0..self.viewport.len() - (1 + SOFT_CLEAR_OFFSET.get().unwrap()) + additional_lines
{
Expand Down

0 comments on commit 48d38c6

Please sign in to comment.