From 50173b24d6cd47e2c0e47f85d148316fc5f4d443 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 5 Apr 2019 15:56:25 +0200 Subject: 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. --- menuconfig.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'menuconfig.py') 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() -- cgit v1.2.3