Commit d4623f3c authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Eradicating the execute flag -- it is almost always TRUE, and when it's FALSE

then it's for a function that is an empty placeholder, so executing it will
not do anything anyway.  Handling the one exception (do_gotolinecolumn_void)
specially, just like the other one (do_cancel) already is.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5029 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 159 additions and 189 deletions
+159 -189
2014-06-28 Benno Schulenberg <bensberg@justemail.net>
* src/prompt.c (do_statusbar_input): Remove the useless parameters
'have_shortcut and 'allow_funcs'; the latter is only ever TRUE.
* src/global.c (shortcut_init), src/prompt.c (do_statusbar_input):
Eradicate the execute flag -- it is only FALSE for functions that are
empty placeholders (so executing them will not do anything anyway) or
for functions ('total_refresh', 'do_suspend_void') that do not exist
in menus with a prompt. The only two exceptions are 'do_cancel' and
'do_gotolinecolumn_void'. The first is handled specially, so do that
too for the second and then get to drop 140 parameters.
2014-06-27 Benno Schulenberg <bensberg@justemail.net>
* src/global.c (shortcut_init): Add default keybindings for Cut,
......
This diff is collapsed.
......@@ -201,15 +201,16 @@ int do_statusbar_input(bool *meta_key, bool *func_key,
'\0' || currmenu != MWRITEFILE)
do_statusbar_backspace();
} else {
/* Handle the normal statusbar prompt shortcuts, setting
/* Handle any other shortcut in the current menu, setting
* ran_func to TRUE if we try to run their associated
* functions and setting finished to TRUE to indicate
* that we're done after running or trying to run their
* associated functions. */
f = sctofunc((sc *) s);
if (s->scfunc != 0 && s->execute == TRUE) {
if (s->scfunc != NULL) {
*ran_func = TRUE;
if (f && (!ISSET(VIEW_MODE) || (f->viewok)))
if (f && (!ISSET(VIEW_MODE) || f->viewok) &&
f->scfunc != do_gotolinecolumn_void)
f->scfunc();
}
*finished = TRUE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment