nano

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

commit a1be8b6a19252f32fe3116fbe0dada05567d9ee6
parent de4fbadf2008f6360b82531920a5ae19e241a321
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu,  1 Mar 2018 11:16:59 +0100

tweaks: condense a comment and elide an 'if'

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

diff --git a/src/rcfile.c b/src/rcfile.c @@ -327,22 +327,17 @@ void parse_syntax(char *ptr) } #endif /* ENABLE_COLOR */ -/* Check whether the given executable function is "universal" (meaning - * any horizontal movement or deletion) and thus is present in almost - * all menus. */ +/* Return TRUE when the given function is present in almost all menus. */ bool is_universal(void (*func)(void)) { - if (func == do_left || func == do_right || + return (func == do_left || func == do_right || func == do_home || func == do_end || #ifndef NANO_TINY func == do_prev_word_void || func == do_next_word_void || #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) - return TRUE; - else - return FALSE; + func == do_tab || func == do_enter || func == do_verbatim_input); } /* Bind or unbind a key combo, to or from a function. */