This commit is contained in:
sxyazi 2024-01-19 13:22:08 +08:00
parent dddf432f1c
commit c7ec9cceff
No known key found for this signature in database

View file

@ -25,13 +25,9 @@ impl Widget for Which<'_> {
}
}
let height = cands.0.len() as u16 + 2;
let area = Rect {
x: 1,
y: area.height.saturating_sub(height + 2),
width: area.width.saturating_sub(2),
height,
};
let height = area.height.min(cands.0.len() as u16 + 2);
let y = area.height.saturating_sub(height + 2);
let area = Rect { x: area.width.min(1), y, width: area.width.saturating_sub(2), height };
let chunks = layout::Layout::new(Direction::Horizontal, [
Constraint::Ratio(1, 3),