diff options
author | ZviRackover <zvirack@gmail.com> | 2018-09-02 01:36:18 +0300 |
---|---|---|
committer | ZviRackover <zvirack@gmail.com> | 2018-09-09 10:45:50 +0300 |
commit | ac13e65ae0ce98516e816ba4fcf468d19e750c30 (patch) | |
tree | e039a2201ece3358068a659b4bb84b204afd866b /src/nvim/edit.c | |
parent | cbdbc4f63d68a6b17b9eea5c67130e37d3d0f278 (diff) | |
download | rneovim-ac13e65ae0ce98516e816ba4fcf468d19e750c30.tar.gz rneovim-ac13e65ae0ce98516e816ba4fcf468d19e750c30.tar.bz2 rneovim-ac13e65ae0ce98516e816ba4fcf468d19e750c30.zip |
Remove has_mbytes local to lines changed in parent commit
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 908dd90cdb..414e2fd36c 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -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++; |