nano

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

commit a374dd035985076a899252749eb1f75121a8ae38
parent aba4f4e0e2a7956b7313ec971bb00248e10bb550
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 21 Aug 2022 10:17:54 +0200

prompt: toggle the help lines only for the 'nohelp' toggle

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

Problem existed since commit 958ec294 from three days ago.

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

diff --git a/src/browser.c b/src/browser.c @@ -523,7 +523,7 @@ char *browse(char *path) #ifndef NANO_TINY /* The terminal dimensions might have changed, so act as if. */ kbinput = KEY_WINCH; - } else if (function == do_toggle) { + } else if (function == do_toggle && get_shortcut(kbinput)->toggle == NO_HELP) { TOGGLE(NO_HELP); window_init(); kbinput = KEY_WINCH; diff --git a/src/prompt.c b/src/prompt.c @@ -520,7 +520,7 @@ functionptrtype acquire_an_answer(int *actual, bool *listed, if (function == do_help || function == full_refresh) function(); #ifndef NANO_TINY - else if (function == do_toggle) { + else if (function == do_toggle && shortcut->toggle == NO_HELP) { TOGGLE(NO_HELP); window_init(); focusing = FALSE; @@ -639,6 +639,7 @@ int ask_user(bool withall, const char *question) const char *yesstr = _("Yy"); const char *nostr = _("Nn"); const char *allstr = _("Aa"); + const keystruct *shortcut; functionptrtype function; while (choice == UNDECIDED) { @@ -735,14 +736,15 @@ int ask_user(bool withall, const char *question) if (choice != UNDECIDED) break; - function = func_from_key(kbinput); + shortcut = get_shortcut(kbinput); + function = (shortcut ? shortcut->func : NULL); if (function == do_cancel) choice = CANCEL; else if (function == full_refresh) full_refresh(); #ifndef NANO_TINY - else if (function == do_toggle) { + else if (function == do_toggle && shortcut->toggle == NO_HELP) { TOGGLE(NO_HELP); window_init(); titlebar(NULL);