Fix minor issues (#1132)
Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
This commit is contained in:
parent
184373ee84
commit
050d7c9c13
|
|
@ -160,6 +160,7 @@ class Menu(TerminalMenu):
|
||||||
preview_command=preview_command,
|
preview_command=preview_command,
|
||||||
preview_size=preview_size,
|
preview_size=preview_size,
|
||||||
preview_title=preview_title,
|
preview_title=preview_title,
|
||||||
|
multi_select_select_on_accept=False,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -309,8 +309,15 @@ class GeneralMenu:
|
||||||
|
|
||||||
if selection and self.auto_cursor:
|
if selection and self.auto_cursor:
|
||||||
cursor_pos = menu_options.index(selection) + 1 # before the strip otherwise fails
|
cursor_pos = menu_options.index(selection) + 1 # before the strip otherwise fails
|
||||||
if cursor_pos >= len(menu_options):
|
|
||||||
cursor_pos = len(menu_options) - 1
|
# in case the new position lands on a "placeholder" we'll skip them as well
|
||||||
|
while True:
|
||||||
|
if cursor_pos >= len(menu_options):
|
||||||
|
cursor_pos = 0
|
||||||
|
if len(menu_options[cursor_pos]) > 0:
|
||||||
|
break
|
||||||
|
cursor_pos += 1
|
||||||
|
|
||||||
selection = selection.strip()
|
selection = selection.strip()
|
||||||
if selection:
|
if selection:
|
||||||
# if this calls returns false, we exit the menu. We allow for an callback for special processing on realeasing control
|
# if this calls returns false, we exit the menu. We allow for an callback for special processing on realeasing control
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue