Skip to content

Commit

Permalink
Fix small screen panics
Browse files Browse the repository at this point in the history
  • Loading branch information
archseer committed Jun 23, 2021
1 parent 2ff9b36 commit 9706f11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helix-term/src/ui/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ impl Prompt {

let height = ((self.completion.len() as u16 + cols - 1) / cols)
.min(10) // at most 10 rows (or less)
.min(area.height);
.min(area.height.saturating_sub(1));

let completion_area = Rect::new(
area.x,
Expand Down Expand Up @@ -331,7 +331,7 @@ impl Prompt {
let viewport = area;
let area = viewport.intersection(Rect::new(
completion_area.x,
completion_area.y - 3,
completion_area.y.saturating_sub(3),
BASE_WIDTH * 3,
3,
));
Expand Down

0 comments on commit 9706f11

Please sign in to comment.