nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 7bad92c50b51d80ab5fff2f8a4cef00a2963dd99
parent d3954901a9a27a1568611bd19a7b9583771ba822
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 28 May 2020 12:09:56 +0200

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.

Diffstat:
Msrc/global.c | 8++++----
Msrc/nano.c | 2++
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/global.c b/src/global.c @@ -1109,11 +1109,11 @@ void shortcut_init(void) add_to_funcs(flip_pipe, MEXECUTE, 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, N_("Cut Till End"), WITHORSANS(cuttilleof_gist), BLANKAFTER, NOVIEW); + + add_to_funcs(do_suspend_void, MEXECUTE, + N_("Suspend"), WITHORSANS(suspend_gist), BLANKAFTER, VIEW); } #endif #ifdef ENABLE_BROWSER @@ -1341,7 +1341,7 @@ void shortcut_init(void) add_to_sclist(MMAIN|MBROWSER|MHELP, "^L", 0, total_refresh, 0); else 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 /* Group of "Appearance" toggles. */ diff --git a/src/nano.c b/src/nano.c @@ -965,6 +965,8 @@ void do_suspend_void(void) statusbar(_("Suspension is not enabled")); beep(); } + + ran_a_tool = TRUE; } /* Handler for SIGCONT (continue after suspend). */