nano

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

commit ef7f825d9736e5f039a3b0fde56a9c382bbffe92
parent 41c1b9623e1d7ad2e745b977560b1f12fc566222
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 28 Feb 2025 13:35:05 +0100

input: adjust file browser and help viewer for changed bracketed pastes

Since the previous commit, the escape-sequence-parsing code does not
set 'bracketed_paste' to FALSE any more when the closing sequence is
deficient.  So, the browser and viewer need to do that themselves.

Also, instead of just beeping and wordlessly discarding a paste when
it's done in the file browser or help viewer, report that it is being
ignored.  This is much more friendly.

Diffstat:
Msrc/browser.c | 7++-----
Msrc/help.c | 7++-----
Msrc/nano.c | 2++
3 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/browser.c b/src/browser.c @@ -484,12 +484,9 @@ char *browse(char *path) } #endif /* ENABLE_MOUSE */ #ifndef NANO_TINY - while (bracketed_paste) + while (bracketed_paste && kbinput != FOREIGN_SEQUENCE) kbinput = get_kbinput(midwin, BLIND); - if (kbinput == BRACKETED_PASTE_MARKER) { - beep(); - continue; - } + bracketed_paste = FALSE; #endif function = interpret(kbinput); diff --git a/src/help.c b/src/help.c @@ -477,12 +477,9 @@ void show_help(void) #ifndef NANO_TINY spotlighted = FALSE; - while (bracketed_paste) + while (bracketed_paste && kbinput != FOREIGN_SEQUENCE) kbinput = get_kbinput(midwin, BLIND); - if (kbinput == BRACKETED_PASTE_MARKER) { - beep(); - continue; - } + bracketed_paste = FALSE; #endif function = interpret(kbinput); diff --git a/src/nano.c b/src/nano.c @@ -1307,6 +1307,8 @@ void unbound_key(int code) statusline(AHEM, _("Missing }")); #endif #ifndef NANO_TINY + else if (code == BRACKETED_PASTE_MARKER) + statusline(AHEM, _("Paste is ignored")); else if (code > KEY_F0 && code < KEY_F0 + 25) /* TRANSLATORS: This refers to an unbound function key. */ statusline(AHEM, _("Unbound key: F%i"), code - KEY_F0);