diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-08-29 08:09:23 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-08-29 08:09:31 +0200 |
| commit | fbd58f9789d27207e30ab2c126773bc6894a15d6 (patch) | |
| tree | 0e14fe20e7f9fc6ae74aa4580bcdc6e8cae26cf0 /menuconfig.py | |
| parent | d1e2a652de33e1b928515277452fd939a290f5ed (diff) | |
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.
Diffstat (limited to 'menuconfig.py')
| -rwxr-xr-x | menuconfig.py | 12 |
1 files changed, 8 insertions, 4 deletions
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() |
