ops: fix i<c-r> with multi-byte text (#6524)

This commit is contained in:
Björn Linse
2017-04-15 11:19:40 +02:00
committed by Justin M. Keyes
parent 58d2ce9bdb
commit 12fc1defd6
2 changed files with 21 additions and 2 deletions

View File

@@ -302,13 +302,13 @@ static void add_num_buff(buffheader_T *buf, long n)
*/
static void add_char_buff(buffheader_T *buf, int c)
{
char bytes[MB_MAXBYTES + 1];
uint8_t bytes[MB_MAXBYTES + 1];
int len;
if (IS_SPECIAL(c)) {
len = 1;
} else {
len = (*mb_char2bytes)(c, (char_u *)bytes);
len = mb_char2bytes(c, bytes);
}
for (int i = 0; i < len; i++) {