mirror of
https://github.com/helix-editor/helix.git
synced 2024-09-20 16:07:55 +03:00
Fix small screen panics
This commit is contained in:
parent
2ff9b362fb
commit
9706f1121d
@ -279,7 +279,7 @@ pub fn render_prompt(&self, area: Rect, surface: &mut Surface, cx: &mut Context)
|
||||
|
||||
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,
|
||||
@ -331,7 +331,7 @@ pub fn render_prompt(&self, area: Rect, surface: &mut Surface, cx: &mut Context)
|
||||
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,
|
||||
));
|
||||
|
Loading…
Reference in New Issue
Block a user