comparison src/misc2.c @ 17720:844f470532b6 v8.1.1857

patch 8.1.1857: cannot use modifier with multi-byte character commit https://github.com/vim/vim/commit/c8fd33d18b49c3246f33782dd7b4a1c87504dd5f Author: Bram Moolenaar <Bram@vim.org> 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.
author Bram Moolenaar <Bram@vim.org>
date Fri, 16 Aug 2019 20:45:04 +0200
parents 10696f279e20
children 04245f071792
comparison
equal deleted inserted replaced
17719:b374e7766fa9 17720:844f470532b6
2817 { 2817 {
2818 if (has_mbyte) 2818 if (has_mbyte)
2819 l = mb_ptr2len(bp + 1); 2819 l = mb_ptr2len(bp + 1);
2820 else 2820 else
2821 l = 1; 2821 l = 1;
2822 /* Anything accepted, like <C-?>. 2822 // Anything accepted, like <C-?>.
2823 * <C-"> or <M-"> are not special in strings as " is 2823 // <C-"> or <M-"> are not special in strings as " is
2824 * the string delimiter. With a backslash it works: <M-\"> */ 2824 // the string delimiter. With a backslash it works: <M-\">
2825 if (!(in_string && bp[1] == '"') && bp[2] == '>') 2825 if (!(in_string && bp[1] == '"') && bp[l + 1] == '>')
2826 bp += l; 2826 bp += l;
2827 else if (in_string && bp[1] == '\\' && bp[2] == '"' 2827 else if (in_string && bp[1] == '\\' && bp[2] == '"'
2828 && bp[3] == '>') 2828 && bp[3] == '>')
2829 bp += 2; 2829 bp += 2;
2830 } 2830 }