diff --git a/src/global.c b/src/global.c index b13a65ac..041b09c2 100644 --- a/src/global.c +++ b/src/global.c @@ -318,9 +318,11 @@ void flip_newbuffer(void) void discard_buffer(void) { } +#ifdef ENABLE_NANORC void implant(void) { } +#endif /* Add a function to the function list. */ void add_to_funcs(void (*func)(void), int menus, const char *desc, const char *help, @@ -1385,11 +1387,13 @@ void set_spell_shortcuts(void) /* Execute the function of the given shortcut. */ void execute(const sc *shortcut) { +#ifdef ENABLE_NANORC if (shortcut->scfunc == implant) /* Insert the corresponding string into the keyboard buffer. */ for (int i = strlen(shortcut->expansion); i > 0; i--) put_back(shortcut->expansion[i - 1]); else +#endif shortcut->scfunc(); } diff --git a/src/nano.h b/src/nano.h index 44d71949..5c25de0b 100644 --- a/src/nano.h +++ b/src/nano.h @@ -439,6 +439,8 @@ typedef struct sc { int ordinal; /* The how-manieth toggle this is, in order to be able to * keep them in sequence. */ +#endif +#ifdef ENABLE_NANORC char *expansion; /* The string of keycodes to which this shortcut is expanded. */ #endif diff --git a/src/rcfile.c b/src/rcfile.c index 1f3e3471..23187335 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -335,6 +335,8 @@ bool is_universal(void (*func)(void)) func == do_home || func == do_end || #ifndef NANO_TINY func == do_prev_word_void || func == do_next_word_void || +#endif +#ifndef ENABLE_NANORC func == implant || #endif func == do_delete || func == do_backspace || @@ -420,7 +422,9 @@ void parse_binding(char *ptr, bool dobind) newsc = nmalloc(sizeof(sc)); newsc->scfunc = implant; newsc->expansion = mallocstrcpy(NULL, funcptr + 1); +#ifndef NANO_TINY newsc->toggle = 0; +#endif } else newsc = strtosc(funcptr);