Remove has_mbytes local to lines changed in parent commit

This commit is contained in:
ZviRackover
2018-09-02 01:36:18 +03:00
parent cbdbc4f63d
commit ac13e65ae0
11 changed files with 51 additions and 128 deletions

View File

@@ -2131,11 +2131,7 @@ int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int
char_u *p = IObuff;
i = 0;
while (i < actual_len && (p - IObuff + 6) < IOSIZE) {
if (has_mbyte) {
p += utf_char2bytes(wca[i++], p);
} else {
*(p++) = wca[i++];
}
p += utf_char2bytes(wca[i++], p);
}
*p = NUL;
}
@@ -3084,7 +3080,7 @@ static void ins_compl_addleader(int c)
if (stop_arrow() == FAIL) {
return;
}
if (has_mbyte && (cc = (*mb_char2len)(c)) > 1) {
if ((cc = utf_char2len(c)) > 1) {
char_u buf[MB_MAXBYTES + 1];
utf_char2bytes(c, buf);
@@ -5334,7 +5330,7 @@ insertchar (
} else {
int cc;
if (has_mbyte && (cc = (*mb_char2len)(c)) > 1) {
if ((cc = utf_char2len(c)) > 1) {
char_u buf[MB_MAXBYTES + 1];
utf_char2bytes(c, buf);
@@ -8660,12 +8656,7 @@ static char_u *do_insert_char_pre(int c)
if (!has_event(EVENT_INSERTCHARPRE)) {
return NULL;
}
if (has_mbyte) {
buf[utf_char2bytes(c, (char_u *) buf)] = NUL;
} else {
buf[0] = c;
buf[1] = NUL;
}
buf[utf_char2bytes(c, (char_u *) buf)] = NUL;
// Lock the text to avoid weird things from happening.
textlock++;