Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/ui/popup.rs')
| -rw-r--r-- | helix-term/src/ui/popup.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/helix-term/src/ui/popup.rs b/helix-term/src/ui/popup.rs index 2cefaf61..db77492d 100644 --- a/helix-term/src/ui/popup.rs +++ b/helix-term/src/ui/popup.rs @@ -344,12 +344,8 @@ impl<T: Component> Component for Popup<T> { let fits = len <= win_height; let scroll_style = cx.editor.theme.get("ui.menu.scroll"); - const fn div_ceil(a: usize, b: usize) -> usize { - (a + b - 1) / b - } - 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)); |