# HG changeset patch # User Bram Moolenaar # Date 1565981104 -7200 # Node ID 844f470532b65e0ea9a3f2fc05d9bc57d02b6683 # Parent b374e7766fa9a8f21a8c51b24059bb6fd83f460b patch 8.1.1857: cannot use modifier with multi-byte character commit https://github.com/vim/vim/commit/c8fd33d18b49c3246f33782dd7b4a1c87504dd5f Author: Bram Moolenaar Date: Fri Aug 16 20:33:05 2019 +0200 patch 8.1.1857: cannot use modifier with multi-byte character Problem: Cannot use modifier with multi-byte character. Solution: Allow using a multi-byte character, although it doesn't work everywhere. diff --git a/src/misc2.c b/src/misc2.c --- a/src/misc2.c +++ b/src/misc2.c @@ -2819,10 +2819,10 @@ find_special_key( l = mb_ptr2len(bp + 1); else l = 1; - /* Anything accepted, like . - * or are not special in strings as " is - * the string delimiter. With a backslash it works: */ - if (!(in_string && bp[1] == '"') && bp[2] == '>') + // Anything accepted, like . + // or are not special in strings as " is + // the string delimiter. With a backslash it works: + if (!(in_string && bp[1] == '"') && bp[l + 1] == '>') bp += l; else if (in_string && bp[1] == '\\' && bp[2] == '"' && bp[3] == '>') diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim --- a/src/testdir/test_mapping.vim +++ b/src/testdir/test_mapping.vim @@ -239,6 +239,12 @@ func Test_map_meta_quotes() iunmap endfunc +func Test_map_meta_multibyte() + imap foo + call assert_equal('foo', maparg("\", 'i')) + iunmap +endfunc + func Test_abbr_after_line_join() new abbr foo bar @@ -292,7 +298,7 @@ func Test_map_timeout_with_timer_interru let g:val = 0 nnoremap \12 :let g:val = 1 nnoremap \123 :let g:val = 2 - set timeout timeoutlen=1000 + set timeout timeoutlen=100 func ExitCb(job, status) let g:timer = timer_start(1, {-> feedkeys("3\", 't')}) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -770,6 +770,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1857, +/**/ 1856, /**/ 1855,