1
0
forked from aniani/vim

updated for version 7.3.285

Problem:    Mapping <Char-123> no longer works.
Solution:   Properly check for "char-".  Add a test for it.
This commit is contained in:
Bram Moolenaar
2011-08-19 22:29:02 +02:00
parent b8bf541f89
commit 792826c0c7
4 changed files with 34 additions and 18 deletions

View File

@@ -2781,6 +2781,12 @@ find_special_key(srcp, modp, keycode, keep_x_key)
} }
if (bp[0] == 't' && bp[1] == '_' && bp[2] && bp[3]) if (bp[0] == 't' && bp[1] == '_' && bp[2] && bp[3])
bp += 3; /* skip t_xx, xx may be '-' or '>' */ 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 '>' */ if (*bp == '>') /* found matching '>' */
@@ -2810,11 +2816,10 @@ find_special_key(srcp, modp, keycode, keep_x_key)
{ {
/* <Char-123> or <Char-033> or <Char-0x33> */ /* <Char-123> or <Char-033> or <Char-0x33> */
vim_str2nr(last_dash + 6, NULL, NULL, TRUE, TRUE, NULL, &n); vim_str2nr(last_dash + 6, NULL, NULL, TRUE, TRUE, NULL, &n);
*modp = modifiers; key = (int)n;
*srcp = end_of_name;
return (int)n;
} }
else
{
/* /*
* Modifier with single letter, or special key name. * Modifier with single letter, or special key name.
*/ */
@@ -2832,6 +2837,7 @@ find_special_key(srcp, modp, keycode, keep_x_key)
if (!keep_x_key) if (!keep_x_key)
key = handle_x_keys(key); key = handle_x_keys(key);
} }
}
/* /*
* get_special_key_code() may return NUL for invalid * get_special_key_code() may return NUL for invalid

View File

@@ -2,6 +2,7 @@
STARTTEST STARTTEST
:so small.vim :so small.vim
:set cpo-=<
:" Test maparg() with a string result :" Test maparg() with a string result
:map foo<C-V> is<F4>foo :map foo<C-V> is<F4>foo
:vnoremap <script> <buffer> <expr> <silent> bar isbar :vnoremap <script> <buffer> <expr> <silent> bar isbar
@@ -9,6 +10,11 @@ STARTTEST
:call append('$', string(maparg('foo<C-V>', '', 0, 1))) :call append('$', string(maparg('foo<C-V>', '', 0, 1)))
:call append('$', string(maparg('bar', '', 0, 1))) :call append('$', string(maparg('bar', '', 0, 1)))
:" :"
:map abc x<char-114>x
:call append('$', maparg('abc'))
:map abc y<S-char-114>y
:call append('$', maparg('abc'))
:"
:/^eof/+1,$w! test.out :/^eof/+1,$w! test.out
:qa! :qa!
ENDTEST ENDTEST

View File

@@ -1,3 +1,5 @@
is<F4>foo is<F4>foo
{'silent': 0, 'noremap': 0, 'lhs': 'foo<C-V>', 'mode': ' ', 'expr': 0, 'sid': 0, 'rhs': 'is<F4>foo', 'buffer': 0} {'silent': 0, 'noremap': 0, 'lhs': 'foo<C-V>', 'mode': ' ', 'expr': 0, 'sid': 0, 'rhs': 'is<F4>foo', 'buffer': 0}
{'silent': 1, 'noremap': 1, 'lhs': 'bar', 'mode': 'v', 'expr': 1, 'sid': 0, 'rhs': 'isbar', 'buffer': 1} {'silent': 1, 'noremap': 1, 'lhs': 'bar', 'mode': 'v', 'expr': 1, 'sid': 0, 'rhs': 'isbar', 'buffer': 1}
xrx
yRy

View File

@@ -709,6 +709,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
285,
/**/ /**/
284, 284,
/**/ /**/