From fbd58f9789d27207e30ab2c126773bc6894a15d6 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 29 Aug 2018 08:09:23 +0200 Subject: menuconfig: Fix a case of needlessly turning on show-all Show-all mode does not need to be enabled when jumping to an invisible symbol with visible children from an implicit submenu, because the invisible symbol will be shown anyway in that case. Explicitly check whether the jumped-to node would be shown instead, and enable show-all mode otherwise. --- menuconfig.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'menuconfig.py') diff --git a/menuconfig.py b/menuconfig.py index a64e535..a8053f1 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -742,12 +742,16 @@ def _jump_to(node): # parent menus before. _parent_screen_rows = [] - # Turn on show-all mode if the node isn't visible - if not (node.prompt and expr_value(node.prompt[1])): - _show_all = True - _cur_menu = _parent_menu(node) _shown = _shown_nodes(_cur_menu) + if node not in _shown: + # Turn on show-all mode if the node wouldn't be shown. Checking whether + # the node is visible instead would needlessly turn on show-all mode in + # an obscure case: when jumping to an invisible symbol with visible + # children from an implicit submenu. + _show_all = True + _shown = _shown_nodes(_cur_menu) + _sel_node_i = _shown.index(node) _center_vertically() -- cgit v1.2.3