nano

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

commit db897b574fa195638a42a647096d28c307f140ab
parent 2b1bc6866a7be5160d03201192c50accd8722f1c
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Thu, 22 Dec 2016 10:42:49 +0100

input: detect again when both Shift and Ctrl are being held on a VT

In nano 2.7.1 and 2.7.2, pressing Shift+Ctrl+Arrow on a Linux console
would behave as if Shift wasn't held.  It got broken three months ago,
by commit 08cd197b, messing up the proper order of the checks.

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

Diffstat:
Msrc/winio.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -539,6 +539,11 @@ int parse_kbinput(WINDOW *win) unsigned char modifiers = 6; if (console && ioctl(0, TIOCLINUX, &modifiers) >= 0) { +#ifndef NANO_TINY + /* Is Shift being held? */ + if (modifiers & 0x01) + shift_held = TRUE; +#endif /* Is Ctrl being held? */ if (modifiers & 0x04) { if (retval == KEY_UP) @@ -550,12 +555,7 @@ int parse_kbinput(WINDOW *win) else if (retval == KEY_RIGHT) return sc_seq_or(do_next_word_void, controlright); } - #ifndef NANO_TINY - /* Is Shift being held? */ - if (modifiers & 0x01) - shift_held =TRUE; - /* Are both Shift and Alt being held? */ if ((modifiers & 0x09) == 0x09) { if (retval == KEY_UP)