From 85461399978681f397719ba25ff0fdb49f889a7e Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 3 Feb 2022 13:04:22 +0100 Subject: [PATCH] build: fix compilation when configured with --enable-tiny Problem existed since commit 3b657a26 from five days ago. In addition, exclude pasting-at-the-prompt from the tiny version, as it's hardly useful when one cannot copy a selected piece of text. --- src/global.c | 4 +++- src/prompt.c | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/global.c b/src/global.c index 86d48425..1f25da7a 100644 --- a/src/global.c +++ b/src/global.c @@ -1187,8 +1187,10 @@ void shortcut_init(void) add_to_sclist(MMAIN, "^\\", 0, do_replace, 0); add_to_sclist(MMAIN, "M-R", 0, do_replace, 0); add_to_sclist(MMOST, "^K", 0, cut_text, 0); +#ifdef NANO_TINY + add_to_sclist(MMAIN, "^U", 0, paste_text, 0); +#else add_to_sclist(MMOST, "^U", 0, paste_text, 0); -#ifndef NANO_TINY add_to_sclist(MMAIN, "^T", 0, do_execute, 0); #endif #ifdef ENABLE_JUSTIFY diff --git a/src/prompt.c b/src/prompt.c index 2ff5d286..30e39f17 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -166,6 +166,7 @@ void lop_the_answer(void) answer[typing_x] = '\0'; } +#ifndef NANO_TINY /* Copy the current answer (if any) into the cutbuffer. */ void copy_the_answer(void) { @@ -193,6 +194,7 @@ void paste_into_answer(void) answer = fusion; typing_x += pastelen; } +#endif #ifdef ENABLE_MOUSE /* Handle a mouse click on the status-bar prompt or the shortcut list. */ @@ -355,12 +357,15 @@ int do_statusbar_input(bool *finished) do_statusbar_backspace(); else if (shortcut->func == cut_text) lop_the_answer(); +#ifndef NANO_TINY else if (shortcut->func == copy_text) copy_the_answer(); else if (shortcut->func == paste_text) { if (cutbuffer != NULL) paste_into_answer(); - } else { + } +#endif + else { /* Handle any other shortcut in the current menu, setting finished * to TRUE to indicate that we're done after running or trying to * run its associated function. */