summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kconfiglib.py9
-rwxr-xr-xmenuconfig.py3
2 files changed, 11 insertions, 1 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index 38bdff2..3d2c82a 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -5389,9 +5389,16 @@ def _flatten(node):
# symbols with children from automatic menu creation) so that their
# children appear after them instead. This gives a clean menu structure
# with no unexpected "jumps" in the indentation.
+ #
+ # Do not flatten promptless choices (which can appear "legitimitely" if a
+ # named choice is defined in multiple locations to add on symbols). It
+ # looks confusing, and the menuconfig already shows all choice symbols if
+ # you enter the choice at some location with a prompt.
while node:
- if node.list and not node.prompt:
+ if node.list and not node.prompt and \
+ not isinstance(node.item, Choice):
+
last_node = node.list
while 1:
last_node.parent = node.parent
diff --git a/menuconfig.py b/menuconfig.py
index 25047f3..2166787 100755
--- a/menuconfig.py
+++ b/menuconfig.py
@@ -1000,6 +1000,9 @@ def _shown_nodes(menu):
# Choices can contain non-symbol items (people do all sorts of weird
# stuff with them), hence the generality here. We really need to
# preserve the menu tree at each choice location.
+ #
+ # Note: Named choices are pretty broken in the C tools, and this is
+ # super obscure, so you probably won't find much that relies on this.
for node in menu.item.nodes:
rec(node.list)
else: