fix(tui/bottom-pane): guard composer height

This commit is contained in:
James Peter
2026-01-06 07:19:14 +10:00
parent 658ddfbf0a
commit 041dff4520
+6 -3
View File
@@ -358,9 +358,10 @@ impl BottomPane<'_> {
x: area.x + horizontal_padding,
y: area.y + y_offset,
width: area.width.saturating_sub(horizontal_padding * 2),
height: (area.height.saturating_sub(y_offset))
- BottomPane::BOTTOM_PAD_LINES
height: (area.height.saturating_sub(y_offset)).saturating_sub(
BottomPane::BOTTOM_PAD_LINES
.min((area.height.saturating_sub(y_offset)).saturating_sub(1)),
),
};
self.composer.cursor_pos(composer_rect)
}
@@ -1221,7 +1222,9 @@ fn compute_composer_rect(area: Rect, top_spacer_enabled: bool) -> Rect {
y_offset = y_offset.saturating_add(1);
}
let available = area.height.saturating_sub(y_offset);
let height = available - BottomPane::BOTTOM_PAD_LINES.min(available.saturating_sub(1));
let height = available.saturating_sub(
BottomPane::BOTTOM_PAD_LINES.min(available.saturating_sub(1)),
);
Rect {
x: area.x + horizontal_padding,
y: area.y + y_offset,