]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.285 v7.3.285
authorBram Moolenaar <Bram@vim.org>
Fri, 19 Aug 2011 20:29:02 +0000 (22:29 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 19 Aug 2011 20:29:02 +0000 (22:29 +0200)
Problem:    Mapping <Char-123> no longer works.
Solution:   Properly check for "char-".  Add a test for it.

src/misc2.c
src/testdir/test75.in
src/testdir/test75.ok
src/version.c

index dbcd653c1ff0acc2fad2bb895e7f04640421cc81..4c05a8cb85e67e03c018b5b955c98087119702b3 100644 (file)
@@ -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);
+               }
            }
 
            /*
index 2de7a089be9d3baf17779d2edebb2c5a11e7e653..5369d8a3df6dade90f3cd66b79c8601dfd8ecd73 100644 (file)
@@ -2,6 +2,7 @@
 
 STARTTEST
 :so small.vim
+:set cpo-=<
 :" Test maparg() with a string result
 :map foo<C-V> is<F4>foo
 :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('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
 :qa!
 ENDTEST
index 791656377d723e719c22a4704d1d7b592a813cf3..af9c96de85e4fbe9a5dbe51b826bbcb0e07ee91d 100644 (file)
@@ -1,3 +1,5 @@
 is<F4>foo
 {'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}
+xrx
+yRy
index 650e99f7bfab1538a41417bdddb5c4c68f006c95..da8d97e09b96a67ce05cb5062feb27e52d01beeb 100644 (file)
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    285,
 /**/
     284,
 /**/