tweaks: reshuffle some code, to be slightly less ugly
parent
bdd8920081
commit
de4fbadf20
14
src/rcfile.c
14
src/rcfile.c
|
@ -336,9 +336,6 @@ bool is_universal(void (*func)(void))
|
||||||
func == do_home || func == do_end ||
|
func == do_home || func == do_end ||
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
func == do_prev_word_void || func == do_next_word_void ||
|
func == do_prev_word_void || func == do_next_word_void ||
|
||||||
#endif
|
|
||||||
#ifdef ENABLE_NANORC
|
|
||||||
func == (void *)implant ||
|
|
||||||
#endif
|
#endif
|
||||||
func == do_delete || func == do_backspace ||
|
func == do_delete || func == do_backspace ||
|
||||||
func == do_cut_text_void || func == do_uncut_text ||
|
func == do_cut_text_void || func == do_uncut_text ||
|
||||||
|
@ -455,12 +452,13 @@ void parse_binding(char *ptr, bool dobind)
|
||||||
if (newsc->func == do_toggle_void)
|
if (newsc->func == do_toggle_void)
|
||||||
mask = MMAIN;
|
mask = MMAIN;
|
||||||
#endif
|
#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. */
|
/* Now limit the given menu to those where the function exists. */
|
||||||
if (is_universal(newsc->func))
|
menu = menu & (is_universal(newsc->func) ? MMOST : mask);
|
||||||
menu = menu & (MMOST | (newsc->func == (void *)implant ? MHELP : 0));
|
|
||||||
else
|
|
||||||
menu = menu & mask;
|
|
||||||
|
|
||||||
if (!menu) {
|
if (!menu) {
|
||||||
rcfile_error(N_("Function '%s' does not exist in menu '%s'"), funcptr, menuptr);
|
rcfile_error(N_("Function '%s' does not exist in menu '%s'"), funcptr, menuptr);
|
||||||
|
|
Loading…
Reference in New Issue