nano

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

commit 89760cd6eca6ecbe637dfb4fe12e487e3a59794e
parent f02e2d3b6efc402bd70a87dff3cb1df66e3aa5b0
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun,  4 Nov 2018 19:42:03 +0100

tweaks: reshuffle some conditions, putting the least likely one first

Diffstat:
Msrc/winio.c | 15++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -609,13 +609,14 @@ int parse_kbinput(WINDOW *win) return SHIFT_TAB; shift_held = TRUE; } - /* Are both Shift and Ctrl being held while Delete is pressed? */ - if ((modifiers & 0x05) == 0x05 && retval == KEY_DC) - return CONTROL_SHIFT_DELETE; - /* Is Meta being held while Delete is pressed? */ - if (modifiers == 0x08 && retval == KEY_DC) { - meta_key = TRUE; - return ALT_DELETE; + /* Is Delete pressed together with either Ctrl+Shift or Meta? */ + if (retval == KEY_DC) { + if ((modifiers & 0x05) == 0x05) + return CONTROL_SHIFT_DELETE; + if (modifiers == 0x08) { + meta_key = TRUE; + return ALT_DELETE; + } } #endif /* Is Ctrl being held? */