bindings: add ^Z (Suspend) to the "Execute Command" menu

This makes suspension more discoverable, and allows the user to rebind
^Z in the main menu without losing the ability to suspend nano.

This drops the ^X (Flip Execute) toggle from the menu -- keeping it
would make an ugly uneven number and would reduce the space for each
menu item too much (clipping "Full Justify" and "Cut Till End") --
but it is still present as a blind toggle.
master
Benno Schulenberg 2020-05-28 12:09:56 +02:00
parent d3954901a9
commit 7bad92c50b
2 changed files with 6 additions and 4 deletions

View File

@ -1109,11 +1109,11 @@ void shortcut_init(void)
add_to_funcs(flip_pipe, MEXECUTE, add_to_funcs(flip_pipe, MEXECUTE,
N_("Pipe Text"), WITHORSANS(pipe_gist), BLANKAFTER, NOVIEW); N_("Pipe Text"), WITHORSANS(pipe_gist), BLANKAFTER, NOVIEW);
add_to_funcs(flip_execute, MEXECUTE,
N_("Read File"), WITHORSANS(readfile_gist), BLANKAFTER, NOVIEW);
add_to_funcs(cut_till_eof, MEXECUTE, add_to_funcs(cut_till_eof, MEXECUTE,
N_("Cut Till End"), WITHORSANS(cuttilleof_gist), BLANKAFTER, NOVIEW); N_("Cut Till End"), WITHORSANS(cuttilleof_gist), BLANKAFTER, NOVIEW);
add_to_funcs(do_suspend_void, MEXECUTE,
N_("Suspend"), WITHORSANS(suspend_gist), BLANKAFTER, VIEW);
} }
#endif #endif
#ifdef ENABLE_BROWSER #ifdef ENABLE_BROWSER
@ -1341,7 +1341,7 @@ void shortcut_init(void)
add_to_sclist(MMAIN|MBROWSER|MHELP, "^L", 0, total_refresh, 0); add_to_sclist(MMAIN|MBROWSER|MHELP, "^L", 0, total_refresh, 0);
else else
add_to_sclist(MMAIN|MBROWSER, "^L", 0, total_refresh, 0); add_to_sclist(MMAIN|MBROWSER, "^L", 0, total_refresh, 0);
add_to_sclist(MMAIN, "^Z", 0, do_suspend_void, 0); add_to_sclist(MMAIN|MEXECUTE, "^Z", 0, do_suspend_void, 0);
#ifndef NANO_TINY #ifndef NANO_TINY
/* Group of "Appearance" toggles. */ /* Group of "Appearance" toggles. */

View File

@ -965,6 +965,8 @@ void do_suspend_void(void)
statusbar(_("Suspension is not enabled")); statusbar(_("Suspension is not enabled"));
beep(); beep();
} }
ran_a_tool = TRUE;
} }
/* Handler for SIGCONT (continue after suspend). */ /* Handler for SIGCONT (continue after suspend). */