diff options
author | ZviRackover <zvirack@gmail.com> | 2018-07-01 22:58:42 +0300 |
---|---|---|
committer | ZviRackover <zvirack@gmail.com> | 2018-08-06 22:27:10 +0300 |
commit | 5cecd7a93aba83cd477519974fc33fadbdcfdc87 (patch) | |
tree | 3d052800def8498c4d26887b881f99e40bb38a46 /src/nvim/regexp.c | |
parent | 071aab51488e03a0e09a0a60aec6c0abc0277279 (diff) | |
download | rneovim-5cecd7a93aba83cd477519974fc33fadbdcfdc87.tar.gz rneovim-5cecd7a93aba83cd477519974fc33fadbdcfdc87.tar.bz2 rneovim-5cecd7a93aba83cd477519974fc33fadbdcfdc87.zip |
style: fixing minor issues noted in code review.
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r-- | src/nvim/regexp.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index a4fb16280c..be6c43493b 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -1103,7 +1103,7 @@ static int get_coll_element(char_u **pp) char_u *p = *pp; if (p[0] != NUL && p[1] == '.') { - l = (*mb_ptr2len)(p + 2); + l = utfc_ptr2len(p + 2); if (p[l + 2] == '.' && p[l + 3] == ']') { c = utf_ptr2char(p + 2); *pp += l + 4; @@ -3444,9 +3444,7 @@ static long bt_regexec_both(char_u *line, /* If there is a "must appear" string, look for it. */ if (prog->regmust != NULL) { - int c; - - c = utf_ptr2char(prog->regmust); + int c = utf_ptr2char(prog->regmust); s = line + col; // This is used very often, esp. for ":global". Use two versions of @@ -5441,7 +5439,7 @@ do_class: } } else if (rex.reg_line_lbr && *scan == '\n' && WITH_NL(OP(p))) { scan++; - } else if (has_mbyte && (len = (*mb_ptr2len)(scan)) > 1) { + } else if ((len = utfc_ptr2len(scan)) > 1) { if ((cstrchr(opnd, utf_ptr2char(scan)) == NULL) == testval) { break; } @@ -6756,14 +6754,13 @@ static int vim_regsub_both(char_u *source, typval_T *expr, char_u *dest, // Write to buffer, if copy is set. if (func_one != NULL) { func_one = (fptr_T)(func_one(&cc, c)); + } else if (func_all != NULL) { + func_all = (fptr_T)(func_all(&cc, c)); } else { - if (func_all != NULL) { - func_all = (fptr_T)(func_all(&cc, c)); - } else { - // just copy - cc = c; - } + // just copy + cc = c; } + if (has_mbyte) { int totlen = mb_ptr2len(src - 1); |