From e1889261381cfc7a5980d84b3d6bd061c56e3ba2 Mon Sep 17 00:00:00 2001 From: Midnight Exigent <36641328+midnightexigent@users.noreply.github.com> Date: Tue, 14 Dec 2021 02:14:23 +0100 Subject: [PATCH] Fix panic when scrolling through completion popup (#1260) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(completion_popup): Fixes #1256 * Update helix-term/src/ui/completion.rs Co-authored-by: Blaž Hrastnik --- helix-term/src/ui/completion.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helix-term/src/ui/completion.rs b/helix-term/src/ui/completion.rs index fcd631998..a55201ff2 100644 --- a/helix-term/src/ui/completion.rs +++ b/helix-term/src/ui/completion.rs @@ -328,8 +328,8 @@ impl Component for Completion { let y = popup_y; if let Some((rel_width, rel_height)) = markdown_doc.required_size((width, height)) { - width = rel_width; - height = rel_height; + width = rel_width.min(width); + height = rel_height.min(height); } Rect::new(x, y, width, height) } else {