diff --git a/src/browser.c b/src/browser.c index 5c6c9c98..07c141a2 100644 --- a/src/browser.c +++ b/src/browser.c @@ -168,6 +168,12 @@ char *do_browser(char *path) #endif #else say_there_is_no_help(); +#endif +#ifndef NANO_TINY + } else if (func == do_toggle_void) { + TOGGLE(NO_HELP); + window_init(); + kbinput = KEY_WINCH; #endif } else if (func == do_search_forward) { do_filesearch(FORWARD); diff --git a/src/global.c b/src/global.c index 14dda3de..d170d7d5 100644 --- a/src/global.c +++ b/src/global.c @@ -1345,7 +1345,7 @@ void shortcut_init(void) #ifndef NANO_TINY /* Group of "Appearance" toggles. */ - add_to_sclist(MMAIN, "M-X", 0, do_toggle_void, NO_HELP); + add_to_sclist((MMOST|MBROWSER|MYESNO) & ~MFINDINHELP, "M-X", 0, do_toggle_void, NO_HELP); add_to_sclist(MMAIN, "M-C", 0, do_toggle_void, CONSTANT_SHOW); add_to_sclist(MMAIN, "M-S", 0, do_toggle_void, SOFTWRAP); add_to_sclist(MMAIN, "M-$", 0, do_toggle_void, SOFTWRAP); diff --git a/src/prompt.c b/src/prompt.c index 11b92df9..d7981444 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -515,6 +515,14 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs, #ifndef NANO_TINY else if (func == do_nothing) finished = FALSE; + else if (func == do_toggle_void) { + TOGGLE(NO_HELP); + window_init(); + focusing = FALSE; + refresh_func(); + bottombars(currmenu); + finished = FALSE; + } #endif /* If we have a shortcut with an associated function, break out if @@ -741,6 +749,15 @@ int do_yesno_prompt(bool all, const char *msg) #endif /* ENABLE_MOUSE */ else if (func_from_key(&kbinput) == full_refresh) full_refresh(); +#ifndef NANO_TINY + else if (func_from_key(&kbinput) == do_toggle_void) { + TOGGLE(NO_HELP); + window_init(); + titlebar(NULL); + focusing = FALSE; + edit_refresh(); + } +#endif else beep(); diff --git a/src/rcfile.c b/src/rcfile.c index 5129b1fa..d6a80a4f 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -816,10 +816,12 @@ void parse_binding(char *ptr, bool dobind) goto free_things; /* Limit the given menu to those where the function exists; - * first handle four special cases, then the general case. */ + * first handle five special cases, then the general case. */ if (is_universal(newsc->func)) menu &= MMOST|MBROWSER; #ifndef NANO_TINY + else if (newsc->func == do_toggle_void && newsc->toggle == NO_HELP) + menu &= (MMOST|MBROWSER|MYESNO) & ~MFINDINHELP; else if (newsc->func == do_toggle_void) menu &= MMAIN; #endif