nano

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

commit 51f27d3f0c26f6dd0e64b68b63fc8ccb302876aa
parent b38265cfb853e191344a9de3a8ec6b5bb7777cc4
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Wed, 19 Aug 2020 08:27:08 +0200

input: hold on to a shift-selected region when an unbound key is struck

There is no reason to deselect the region, as nothing has changed.

(This also retains the shift-selected region when a non-shortcut key is
typed in view mode, which makes sense, as again nothing was changed.)

This fixes https://savannah.gnu.org/bugs/?58980.

Bug existed since version 4.9, commit 0ed62e84.

Diffstat:
Msrc/nano.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -1552,16 +1552,16 @@ void process_a_keystroke(void) else if (ISSET(VIEW_MODE)) print_view_warning(); else { +#ifndef NANO_TINY + if (openfile->mark && openfile->kind_of_mark == SOFTMARK) { + openfile->mark = NULL; + refresh_needed = TRUE; + } +#endif /* Store the byte, and leave room for a terminating zero. */ puddle = charealloc(puddle, depth + 2); puddle[depth++] = (char)input; } -#ifndef NANO_TINY - if (openfile->mark && openfile->kind_of_mark == SOFTMARK) { - openfile->mark = NULL; - refresh_needed = TRUE; - } -#endif } /* If we have a command, or if there aren't any other key codes waiting,