on master help sign in
Fix small screen panics
commit9706f1121de673950d8e0472062a32f18d527ad2 authorBlaž Hrastnik <blaz@mxxn.io> dateWed 23 Jun 2021, 13:13 (5 years ago) parent2ff9b36
1 file changed+2−2
helix-term/src/ui/prompt.rs+2−2
helix-term/src/ui/prompt.rs+2−2
@@ -279,7 +279,7 @@ impl Prompt {
279279
280280 let height = ((self.completion.len() as u16 + cols - 1) / cols)
281281 .min(10) // at most 10 rows (or less)
282− .min(area.height);
282+ .min(area.height.saturating_sub(1));
283283
284284 let completion_area = Rect::new(
285285 area.x,
@@ -331,7 +331,7 @@ impl Prompt {
331331 let viewport = area;
332332 let area = viewport.intersection(Rect::new(
333333 completion_area.x,
334− completion_area.y - 3,
334+ completion_area.y.saturating_sub(3),
335335 BASE_WIDTH * 3,
336336 3,
337337 ));