From f9622694c5221a0b0f74bf345c5ef832ed79c16a Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 22 May 2019 08:18:48 +0200 Subject: menuconfig: Fix inconsistent top/bottom scroll offset due to off-by-one The scroll offset when scrolling up was one more than when scrolling down, due to an off-by-one. --- menuconfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/menuconfig.py b/menuconfig.py index f804057..8ecf611 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -1219,7 +1219,7 @@ def _select_prev_menu_entry(): _sel_node_i -= 1 # See _select_next_menu_entry() - if _sel_node_i <= _menu_scroll + _SCROLL_OFFSET: + if _sel_node_i < _menu_scroll + _SCROLL_OFFSET: _menu_scroll = max(_menu_scroll - 1, 0) @@ -2034,7 +2034,7 @@ def _jump_to_dialog(): if sel_node_i > 0: sel_node_i -= 1 - if sel_node_i <= scroll + _SCROLL_OFFSET: + if sel_node_i < scroll + _SCROLL_OFFSET: scroll = max(scroll - 1, 0) while True: -- cgit v1.2.3