Fix panic when scrolling through completion popup (#1260)

* fix(completion_popup): Fixes #1256

* Update helix-term/src/ui/completion.rs

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
This commit is contained in:
Midnight Exigent 2021-12-14 02:14:23 +01:00 committed by GitHub
parent 10ad25b95b
commit e188926138
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {