Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/ui/menu.rs')
-rw-r--r--helix-term/src/ui/menu.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/helix-term/src/ui/menu.rs b/helix-term/src/ui/menu.rs
index ffe3ebb3..612832ce 100644
--- a/helix-term/src/ui/menu.rs
+++ b/helix-term/src/ui/menu.rs
@@ -346,10 +346,6 @@ impl<T: Item + 'static> Component for Menu<T> {
let win_height = area.height as usize;
- const fn div_ceil(a: usize, b: usize) -> usize {
- (a + b - 1) / b
- }
-
let rows = options
.iter()
.map(|option| option.format(&self.editor_data));
@@ -390,7 +386,7 @@ impl<T: Item + 'static> Component for Menu<T> {
let scroll_style = theme.get("ui.menu.scroll");
if !fits {
- let scroll_height = div_ceil(win_height.pow(2), len).min(win_height);
+ let scroll_height = win_height.pow(2).div_ceil(len).min(win_height);
let scroll_line = (win_height - scroll_height) * scroll
/ std::cmp::max(1, len.saturating_sub(win_height));