Curses: prevent menu search without menu options

First noticed this when watching someone livestream, and managed
to figure it out from there: The window that pops up when looking
at a pile of objects under you by pressing ':' is marked as a menu,
but has no selectable options.  Curses still allowed you to use the
menu-search command (':') on it.

Prevent the menu search command in windows with no selectable entries.
This commit is contained in:
Pasi Kallinen
2024-09-08 20:27:17 +03:00
parent 3c80aa7e86
commit 6f64ed90ed

View File

@@ -1444,6 +1444,9 @@ curs_nonselect_menu_action(
case MENU_SEARCH: {
char search_key[BUFSZ];
if (how == PICK_NONE)
break;
search_key[0] = '\0';
curses_line_input_dialog("Search for:", search_key, BUFSZ);