aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-08-08 01:24:18 +0200
committerGitHub <noreply@github.com>2018-08-08 01:24:18 +0200
commitc06613d2f6c3f3a864c43e03b95d12efb3e0f4a6 (patch)
tree3d052800def8498c4d26887b881f99e40bb38a46 /src/nvim/ex_docmd.c
parent1593ee7cf21f77168531c959fa9e73933b502d2e (diff)
parent5cecd7a93aba83cd477519974fc33fadbdcfdc87 (diff)
downloadrneovim-c06613d2f6c3f3a864c43e03b95d12efb3e0f4a6.tar.gz
rneovim-c06613d2f6c3f3a864c43e03b95d12efb3e0f4a6.tar.bz2
rneovim-c06613d2f6c3f3a864c43e03b95d12efb3e0f4a6.zip
Merge #8665 'Remove mb_ptr2char macro'
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 0ab0178d24..3d3d02fd71 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -2899,11 +2899,7 @@ const char * set_one_cmd_context(
xp->xp_pattern = skipwhite((const char_u *)arg);
p = (const char *)xp->xp_pattern;
while (*p != NUL) {
- if (has_mbyte) {
- c = mb_ptr2char((const char_u *)p);
- } else {
- c = (uint8_t)(*p);
- }
+ c = utf_ptr2char((const char_u *)p);
if (c == '\\' && p[1] != NUL) {
p++;
} else if (c == '`') {
@@ -2921,19 +2917,11 @@ const char * set_one_cmd_context(
|| ascii_iswhite(c)) {
len = 0; /* avoid getting stuck when space is in 'isfname' */
while (*p != NUL) {
- if (has_mbyte) {
- c = mb_ptr2char((const char_u *)p);
- } else {
- c = *p;
- }
+ c = utf_ptr2char((const char_u *)p);
if (c == '`' || vim_isfilec_or_wc(c)) {
break;
}
- if (has_mbyte) {
- len = (size_t)(*mb_ptr2len)((const char_u *)p);
- } else {
- len = 1;
- }
+ len = (size_t)utfc_ptr2len((const char_u *)p);
MB_PTR_ADV(p);
}
if (in_quote) {