]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.204 v7.4.204
authorBram Moolenaar <Bram@vim.org>
Wed, 12 Mar 2014 19:17:51 +0000 (20:17 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 12 Mar 2014 19:17:51 +0000 (20:17 +0100)
Problem:    A mapping where the second byte is 0x80 doesn't work.
Solution:   Unescape before checking for incomplete multi-byte char. (Nobuhiro
            Takasaki)

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

index cc30f9412c7ecb12324d531ac6941e6684e28028..7455c778d8b46db0caf22caae0544b86da38c577 100644 (file)
@@ -2206,10 +2206,16 @@ vgetorpeek(advance)
 #ifdef FEAT_MBYTE
                                /* Don't allow mapping the first byte(s) of a
                                 * multi-byte char.  Happens when mapping
-                                * <M-a> and then changing 'encoding'. */
-                               if (has_mbyte && MB_BYTE2LEN(c1)
-                                                 > (*mb_ptr2len)(mp->m_keys))
-                                   mlen = 0;
+                                * <M-a> and then changing 'encoding'. Beware
+                                * that 0x80 is escaped. */
+                               {
+                                   char_u *p1 = mp->m_keys;
+                                   char_u *p2 = mb_unescape(&p1);
+
+                                   if (has_mbyte && p2 != NULL
+                                         && MB_BYTE2LEN(c1) > MB_PTR2LEN(p2))
+                                       mlen = 0;
+                               }
 #endif
                                /*
                                 * Check an entry whether it matches.
index 4bd8279a36c12f223d9f698718119c7a8ae8c101..b7f2783f54d4a31341446aeea2c8e99c4ad6b3db 100644 (file)
@@ -1,8 +1,11 @@
 Tests for maparg().
+Also test utf8 map with a 0x80 byte.
 
 STARTTEST
 :so small.vim
+:so mbyte.vim
 :set cpo-=<
+:set encoding=utf8
 :" Test maparg() with a string result
 :map foo<C-V> is<F4>foo
 :vnoremap <script> <buffer> <expr> <silent> bar isbar
@@ -17,6 +20,20 @@ STARTTEST
 :map abc y<S-char-114>y
 :call append('$', maparg('abc'))
 :"
+Go\e:"
+:" Outside of the range, minimum
+:inoremap <Char-0x1040> a
+:call feedkeys("a\u1040\<Esc>")
+:" Inside of the range, minimum
+:inoremap <Char-0x103f> b
+:call feedkeys("a\u103f\<Esc>")
+:" Inside of the range, maximum
+:inoremap <Char-0xf03f> c
+:call feedkeys("a\uf03f\<Esc>")
+:" Outside of the range, maximum
+:inoremap <Char-0xf040> d
+:call feedkeys("a\uf040\<Esc>")
+:"
 :/^eof/+1,$w! test.out
 :qa!
 ENDTEST
index d8f9a2aadaaa317de66547d480d5a1a22262e91f..a2c5c5ac3dfc37818b7cafe549aae4a70509b590 100644 (file)
@@ -4,3 +4,4 @@ is<F4>foo
 {'silent': 0, 'noremap': 0, 'lhs': 'foo', 'mode': ' ', 'nowait': 1, 'expr': 0, 'sid': 0, 'rhs': 'bar', 'buffer': 1}
 xrx
 yRy
+abcd
index 112e168e04240bc807f624c6cde1dbf9c806cf3a..5a50c2e9dbaa104bfcac3bcf88a6367cd5f98b70 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    204,
 /**/
     203,
 /**/