tweaks: drop an unneeded check for permissibility of prompt shortcuts

The only menus that are accessible in view mode are WhereIs, Insert,
WhereIsFile, GoToDirectory, and Help.  In the WhereIs menu, the only
keystroke that is not allowed in view mode (^R) is caught explicitly.
In the other four menus, all available shortcuts are permissible in
view mode, so... there is no need to check them at execution time.

(The ^R keystroke in the WhereIs menu is still shown in view mode
so as not to upset the pairing of the subsequent shortcuts.)
This commit is contained in:
Benno Schulenberg 2022-08-15 12:06:52 +02:00
parent 78d284881c
commit 433dd92196
2 changed files with 2 additions and 6 deletions

View File

@ -366,11 +366,8 @@ int do_statusbar_input(bool *finished)
}
#endif
else {
/* Handle any other shortcut in the current menu, setting finished
* to TRUE to indicate that we're done after running or trying to
* run its associated function. */
if (!ISSET(VIEW_MODE) || okay_for_view(shortcut))
shortcut->func();
/* Handle some other shortcut, and indicate that we're done. */
shortcut->func();
*finished = TRUE;
}
}

View File

@ -424,7 +424,6 @@ void terminal_init(void);
void confirm_margin(void);
#endif
void unbound_key(int code);
bool okay_for_view(const keystruct *shortcut);
void inject(char *burst, size_t count);
/* Most functions in prompt.c. */