mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 12:51:23 +03:00
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:
parent
78d284881c
commit
433dd92196
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user