clamp render area to terminal size (#1758)

this fixes a couple of panics that would happen when trying to render
something larger than the terminal, or insert history lines when the top
of the viewport is at y=0.
This commit is contained in:
Jeremy Rose
2025-07-31 09:59:36 -07:00
committed by GitHub
parent 861ba86403
commit 96654a5d52
2 changed files with 3 additions and 3 deletions

View File

@@ -362,7 +362,7 @@ impl App<'_> {
AppState::GitWarning { .. } => 10,
};
let mut area = terminal.viewport_area;
area.height = desired_height;
area.height = desired_height.min(size.height);
area.width = size.width;
if area.bottom() > size.height {
terminal