commit 7e53fcb581b1f25ba863b82aa799fa6724d70ef1
parent 8249f3560f59a5ee5c21c3d79841372387c89ea6
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 21 Jul 2020 13:46:21 +0200
tweaks: remove two redundant conditions, and make a more direct return
The escape-parsing routine nowadays returns FOREIGN_SEQUENCE instead
of ERR when encountering an unknown sequence. So, with the two cases
that demand ERR now handled directly, there is no need to check for
ERR any more.
Diffstat:
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -1026,11 +1026,11 @@ int parse_kbinput(WINDOW *win)
}
escapes = 0;
}
- } else if (keycode == '[' && key_buffer_len > 0 &&
- (('A' <= *key_buffer && *key_buffer <= 'D') ||
- ('a' <= *key_buffer && *key_buffer <= 'd'))) {
+ } else if (keycode == '[' && (('A' <= *key_buffer && *key_buffer <= 'D') ||
+ ('a' <= *key_buffer && *key_buffer <= 'd'))) {
/* An iTerm2/Eterm/rxvt sequence: ^[ ^[ [ X. */
double_esc = TRUE;
+ return ERR;
} else {
/* Two escapes followed by a non-escape, and there are more
* codes waiting: combined meta and escape sequence mode. */
@@ -1058,9 +1058,6 @@ int parse_kbinput(WINDOW *win)
break;
}
- if (retval == ERR)
- return ERR;
-
if (retval == controlleft)
return CONTROL_LEFT;
else if (retval == controlright)