]> granicus.if.org Git - vim/commitdiff
patch 8.1.1857: cannot use modifier with multi-byte character v8.1.1857
authorBram Moolenaar <Bram@vim.org>
Fri, 16 Aug 2019 18:33:05 +0000 (20:33 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 16 Aug 2019 18:33:05 +0000 (20:33 +0200)
Problem:    Cannot use modifier with multi-byte character.
Solution:   Allow using a multi-byte character, although it doesn't work
            everywhere.

src/misc2.c
src/testdir/test_mapping.vim
src/version.c

index 463b37b79d40ee575ecfc585f980c0642730d19b..db3687d71cdf75a3dafe989e0798c6ea01393e3b 100644 (file)
@@ -2819,10 +2819,10 @@ find_special_key(
                    l = mb_ptr2len(bp + 1);
                else
                    l = 1;
-               /* Anything accepted, like <C-?>.
-                * <C-"> or <M-"> are not special in strings as " is
-                * the string delimiter. With a backslash it works: <M-\"> */
-               if (!(in_string && bp[1] == '"') && bp[2] == '>')
+               // Anything accepted, like <C-?>.
+               // <C-"> or <M-"> are not special in strings as " is
+               // the string delimiter. With a backslash it works: <M-\">
+               if (!(in_string && bp[1] == '"') && bp[l + 1] == '>')
                    bp += l;
                else if (in_string && bp[1] == '\\' && bp[2] == '"'
                                                               && bp[3] == '>')
index 71548edda0cc4e83238d549c179372f180a1013f..b189296b536aed0955adc37b1c4d2a0a946c66b8 100644 (file)
@@ -239,6 +239,12 @@ func Test_map_meta_quotes()
   iunmap <M-">
 endfunc
 
+func Test_map_meta_multibyte()
+  imap <M-á> foo
+  call assert_equal('foo', maparg("\<M-á>", 'i'))
+  iunmap <M-á>
+endfunc
+
 func Test_abbr_after_line_join()
   new
   abbr foo bar
@@ -292,7 +298,7 @@ func Test_map_timeout_with_timer_interrupt()
   let g:val = 0
   nnoremap \12 :let g:val = 1<CR>
   nnoremap \123 :let g:val = 2<CR>
-  set timeout timeoutlen=1000
+  set timeout timeoutlen=100
 
   func ExitCb(job, status)
     let g:timer = timer_start(1, {-> feedkeys("3\<Esc>", 't')})
index f7be012951bb924bc0a604d296811fe0054e7e68..5bd944dfc11be7d334daed5111ac20ef0dacd170 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1857,
 /**/
     1856,
 /**/