summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2019-04-05 15:56:25 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2019-04-05 16:07:57 +0200
commit50173b24d6cd47e2c0e47f85d148316fc5f4d443 (patch)
treed2b331de8c1601be1c45b481507bc80c150bc7c8
parentf715e95acebc66a38e981023630690bd64f0be6e (diff)
menuconfig: Avoid needlessly turning on show-all in rare cases
Loading a new configuration with the cursor on an invisible item with visible children (can happen with optional prompts) would needlessly turn on show-all, even though such invisible items are always shown. Fix it by doing a more explicit check for whether the selected item shows up in the menu after loading the configuration, like _toggle_show_all() and _jump_to() do.
-rwxr-xr-xmenuconfig.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/menuconfig.py b/menuconfig.py
index 9ed46cc..bf8bf31 100755
--- a/menuconfig.py
+++ b/menuconfig.py
@@ -1756,9 +1756,8 @@ def _load_dialog():
if _try_load(filename):
# Turn on show-all mode if the selected node is not visible after
- # loading the new configuration
- sel_node = _shown[_sel_node_i]
- if not (sel_node.prompt and expr_value(sel_node.prompt[1])):
+ # loading the new configuration. _shown still holds the old state.
+ if _shown[_sel_node_i] not in _shown_nodes(_cur_menu):
_show_all = True
_update_menu()