Fix padding calculation (#1205)

Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
This commit is contained in:
Daniel Girtler 2022-05-17 20:56:41 +10:00 committed by GitHub
parent 72a44e34ef
commit 32432b2fdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -272,7 +272,8 @@ class GeneralMenu:
return max([len(str(selection.description)) for selection in entries])
def _find_selection(self, selection_name: str) -> Tuple[str, Selector]:
padding = self._get_menu_text_padding(list(self._menu_options.values()))
enabled_menus = self._menus_to_enable()
padding = self._get_menu_text_padding(list(enabled_menus.values()))
option = [(k, v) for k, v in self._menu_options.items() if v.menu_text(padding).strip() == selection_name.strip()]
if len(option) != 1: