diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2018-09-11 09:03:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-11 09:03:09 +0200 |
commit | d6b3c09129dee687b33db719be5bb3e2b51deccc (patch) | |
tree | b22b43c8a0f117a6cf6b61558c83fe3131f791f0 /src/nvim/eval.c | |
parent | 036051b218760c6c8ff70b2ff347916acab993ff (diff) | |
parent | 329cfc3303cffd5c9aad7b2ad7f4323354d68b0d (diff) | |
download | rneovim-d6b3c09129dee687b33db719be5bb3e2b51deccc.tar.gz rneovim-d6b3c09129dee687b33db719be5bb3e2b51deccc.tar.bz2 rneovim-d6b3c09129dee687b33db719be5bb3e2b51deccc.zip |
Merge pull request #8945 from ZviRackover/fix-7401-step5
mbyte: remove mb_char2bytes
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index e031b594a3..b7f5d93bf3 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -4722,10 +4722,11 @@ static int get_string_tv(char_u **arg, typval_T *rettv, int evaluate) ++p; /* For "\u" store the number according to * 'encoding'. */ - if (c != 'X') - name += (*mb_char2bytes)(nr, name); - else + if (c != 'X') { + name += utf_char2bytes(nr, name); + } else { *name++ = nr; + } } break; @@ -9488,10 +9489,9 @@ static void f_getchar(typval_T *argvars, typval_T *rettv, FunPtr fptr) temp[i++] = K_SPECIAL; temp[i++] = K_SECOND(n); temp[i++] = K_THIRD(n); - } else if (has_mbyte) - i += (*mb_char2bytes)(n, temp + i); - else - temp[i++] = n; + } else { + i += utf_char2bytes(n, temp + i); + } temp[i++] = NUL; rettv->v_type = VAR_STRING; rettv->vval.v_string = vim_strsave(temp); @@ -10021,7 +10021,7 @@ static void f_getmatches(typval_T *argvars, typval_T *rettv, FunPtr fptr) if (cur->conceal_char) { char buf[MB_MAXBYTES + 1]; - buf[(*mb_char2bytes)((int)cur->conceal_char, (char_u *)buf)] = NUL; + buf[utf_char2bytes((int)cur->conceal_char, (char_u *)buf)] = NUL; tv_dict_add_str(dict, S_LEN("conceal"), buf); } @@ -18361,12 +18361,7 @@ void set_vim_var_char(int c) { char buf[MB_MAXBYTES + 1]; - if (has_mbyte) { - buf[(*mb_char2bytes)(c, (char_u *) buf)] = NUL; - } else { - buf[0] = c; - buf[1] = NUL; - } + buf[utf_char2bytes(c, (char_u *)buf)] = NUL; set_vim_var_string(VV_CHAR, buf, -1); } |