bindings: make ^L (Refresh) work at all the prompts too

(Unfortunately, this means that ^L cannot be used for the
Linter in the "Execute Command" menu.)

This fixes https://savannah.gnu.org/bugs/?58469.

Bug existed since around version 2.1.0.
master
Benno Schulenberg 2020-05-31 19:09:48 +02:00
parent bc92e28b30
commit d729edaeda
3 changed files with 10 additions and 11 deletions

View File

@ -1190,7 +1190,7 @@ void shortcut_init(void)
#endif
#ifdef ENABLE_COLOR
add_to_sclist(MMAIN, "M-B", 0, do_linter, 0);
add_to_sclist(MEXECUTE, "^L", 0, do_linter, 0);
add_to_sclist(MEXECUTE, "^Y", 0, do_linter, 0);
add_to_sclist(MMAIN, "M-F", 0, do_formatter, 0);
add_to_sclist(MEXECUTE, "^O", 0, do_formatter, 0);
#endif
@ -1336,9 +1336,9 @@ void shortcut_init(void)
add_to_sclist(MEXECUTE, "^J", 0, do_full_justify, 0);
#endif
if (!ISSET(PRESERVE))
add_to_sclist(MMAIN|MBROWSER|MHELP, "^L", 0, full_refresh, 0);
add_to_sclist(MMOST|MBROWSER|MHELP|MYESNO, "^L", 0, full_refresh, 0);
else
add_to_sclist(MMAIN|MBROWSER, "^L", 0, full_refresh, 0);
add_to_sclist(MMOST|MBROWSER|MYESNO, "^L", 0, full_refresh, 0);
add_to_sclist(MMAIN|MEXECUTE, "^Z", 0, do_suspend_void, 0);
#ifndef NANO_TINY

View File

@ -509,14 +509,9 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
}
} else
#endif /* ENABLE_HISTORIES */
if (func == do_help) {
/* This key has a shortcut-list entry when it's used to go to
* the help viewer or display a message indicating that help
* is disabled, which means that finished has been set to TRUE.
* Set it back to FALSE here, so that we aren't kicked out of
* the status-bar prompt. */
/* If we ran a function that should not exit from the prompt... */
if (func == do_help || func == full_refresh)
finished = FALSE;
}
#ifndef NANO_TINY
else if (func == do_nothing)
finished = FALSE;
@ -744,6 +739,8 @@ int do_yesno_prompt(bool all, const char *msg)
}
}
#endif /* ENABLE_MOUSE */
else if (func_from_key(&kbinput) == full_refresh)
full_refresh();
else
beep();

View File

@ -813,13 +813,15 @@ void parse_binding(char *ptr, bool dobind)
goto free_things;
/* Limit the given menu to those where the function exists;
* first handle three special cases, then the general case. */
* first handle four special cases, then the general case. */
if (is_universal(newsc->func))
menu &= MMOST|MBROWSER;
#ifndef NANO_TINY
else if (newsc->func == do_toggle_void)
menu &= MMAIN;
#endif
else if (newsc->func == full_refresh)
menu &= MMOST|MBROWSER|MHELP|MYESNO;
else if (newsc->func == (functionptrtype)implant)
menu &= MMOST|MBROWSER|MHELP;
else {