nano

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

commit de4fbadf2008f6360b82531920a5ae19e241a321
parent bdd8920081974d72f71fe421acee5deb7f9d4c1c
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu,  1 Mar 2018 11:08:13 +0100

tweaks: reshuffle some code, to be slightly less ugly

Diffstat:
Msrc/rcfile.c | 14++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/rcfile.c b/src/rcfile.c @@ -337,9 +337,6 @@ bool is_universal(void (*func)(void)) #ifndef NANO_TINY func == do_prev_word_void || func == do_next_word_void || #endif -#ifdef ENABLE_NANORC - func == (void *)implant || -#endif func == do_delete || func == do_backspace || func == do_cut_text_void || func == do_uncut_text || func == do_tab || func == do_enter || func == do_verbatim_input) @@ -455,12 +452,13 @@ void parse_binding(char *ptr, bool dobind) if (newsc->func == do_toggle_void) mask = MMAIN; #endif - +#ifdef ENABLE_NANORC + /* Handle the special case of a key defined as a string. */ + if (newsc->func == (void *)implant) + mask = MMOST | MHELP; +#endif /* Now limit the given menu to those where the function exists. */ - if (is_universal(newsc->func)) - menu = menu & (MMOST | (newsc->func == (void *)implant ? MHELP : 0)); - else - menu = menu & mask; + menu = menu & (is_universal(newsc->func) ? MMOST : mask); if (!menu) { rcfile_error(N_("Function '%s' does not exist in menu '%s'"), funcptr, menuptr);