diff options
author | nicm <nicm> | 2014-02-10 11:20:41 +0000 |
---|---|---|
committer | nicm <nicm> | 2014-02-10 11:20:41 +0000 |
commit | c52548f6fd311e4df3076ba4cc6f6ab8849557ac (patch) | |
tree | 8b91edfc363982b1159167d75d8dc7b9e770c242 /tty-keys.c | |
parent | 973de5a704d4858b7626fc7a07865c1ea8f71eac (diff) |
The last fix to xterm keys meant that some keys such as \033OA were
being wrongly treated as partial matches. So both check xterm keys after
standard keys and only wildcard the minimum required ('1' to
'8'). Problems reported by Ralf Horstmann and Tim van der Molen.
Diffstat (limited to 'tty-keys.c')
-rw-r--r-- | tty-keys.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -479,6 +479,15 @@ tty_keys_next(struct tty *tty) goto partial_key; } + /* Look for matching key string and return if found. */ + tk = tty_keys_find(tty, buf, len, &size); + if (tk != NULL) { + if (tk->next != NULL) + goto partial_key; + key = tk->key; + goto complete_key; + } + /* Try to parse a key with an xterm-style modifier. */ switch (xterm_keys_find(buf, len, &size, &key)) { case 0: /* found */ @@ -489,15 +498,6 @@ tty_keys_next(struct tty *tty) goto partial_key; } - /* Look for matching key string and return if found. */ - tk = tty_keys_find(tty, buf, len, &size); - if (tk != NULL) { - if (tk->next != NULL) - goto partial_key; - key = tk->key; - goto complete_key; - } - first_key: /* Is this a meta key? */ if (len >= 2 && buf[0] == '\033') { |