diff options
author | Bram Moolenaar <Bram@vim.org> | 2011-08-19 22:29:02 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2011-08-19 22:29:02 +0200 |
commit | 792826c0c715e037d7cca4d1a671c3b325e801a0 (patch) | |
tree | 77256b5d1b1e9181a2b0df73e4a4057b528b4234 /src/misc2.c | |
parent | b8bf541f8944a9a0ea0a4b75f8d18a565f5d91d1 (diff) | |
download | vim-792826c0c715e037d7cca4d1a671c3b325e801a0.zip |
updated for version 7.3.285
Problem: Mapping <Char-123> no longer works.
Solution: Properly check for "char-". Add a test for it.
Diffstat (limited to 'src/misc2.c')
-rw-r--r-- | src/misc2.c | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/src/misc2.c b/src/misc2.c index dbcd653c1..4c05a8cb8 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -2781,6 +2781,12 @@ find_special_key(srcp, modp, keycode, keep_x_key) } if (bp[0] == 't' && bp[1] == '_' && bp[2] && bp[3]) bp += 3; /* skip t_xx, xx may be '-' or '>' */ + else if (STRNICMP(bp, "char-", 5) == 0) + { + vim_str2nr(bp + 5, NULL, &l, TRUE, TRUE, NULL, NULL); + bp += l + 5; + break; + } } if (*bp == '>') /* found matching '>' */ @@ -2810,27 +2816,27 @@ find_special_key(srcp, modp, keycode, keep_x_key) { /* <Char-123> or <Char-033> or <Char-0x33> */ vim_str2nr(last_dash + 6, NULL, NULL, TRUE, TRUE, NULL, &n); - *modp = modifiers; - *srcp = end_of_name; - return (int)n; + key = (int)n; } - - /* - * Modifier with single letter, or special key name. - */ -#ifdef FEAT_MBYTE - if (has_mbyte) - l = mb_ptr2len(last_dash + 1); - else -#endif - l = 1; - if (modifiers != 0 && last_dash[l + 1] == '>') - key = PTR2CHAR(last_dash + 1); else { - key = get_special_key_code(last_dash + 1); - if (!keep_x_key) - key = handle_x_keys(key); + /* + * Modifier with single letter, or special key name. + */ +#ifdef FEAT_MBYTE + if (has_mbyte) + l = mb_ptr2len(last_dash + 1); + else +#endif + l = 1; + if (modifiers != 0 && last_dash[l + 1] == '>') + key = PTR2CHAR(last_dash + 1); + else + { + key = get_special_key_code(last_dash + 1); + if (!keep_x_key) + key = handle_x_keys(key); + } } /* |