Avoid panic on very long prompt lines

This commit is contained in:
Kenny Levinsen
2023-02-14 00:28:40 +01:00
parent 59e2f658db
commit b09f642fd6
2 changed files with 14 additions and 5 deletions
+2 -1
View File
@@ -356,10 +356,11 @@ impl InterfaceWidget for Launcher {
intf.geometry.height,
(self.matches.len() + 1) as u32 * line_height + 8,
);
let content_width = min(intf.geometry.width, x_max.0 + 1);
Geometry {
x: intf.geometry.x,
y: intf.geometry.y + intf.geometry.height - content_height,
width: x_max.0 + 1,
width: content_width,
height: content_height,
}
}