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.
master
Benno Schulenberg 2020-08-19 08:27:08 +02:00
parent b38265cfb8
commit 51f27d3f0c
1 changed files with 6 additions and 6 deletions

View File

@ -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,