diff options
Diffstat (limited to 'src/nvim/regexp.c')
| -rw-r--r-- | src/nvim/regexp.c | 32 | 
1 files changed, 17 insertions, 15 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 96884aa87f..dbf591d0d1 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -2350,7 +2350,7 @@ collection:                break;              case CLASS_LOWER:                for (cu = 1; cu <= 255; cu++) { -                if (vim_islower(cu) && cu != 170 && cu != 186) { +                if (mb_islower(cu) && cu != 170 && cu != 186) {                    regmbc(cu);                  }                } @@ -2376,7 +2376,7 @@ collection:                break;              case CLASS_UPPER:                for (cu = 1; cu <= 255; cu++) { -                if (vim_isupper(cu)) { +                if (mb_isupper(cu)) {                    regmbc(cu);                  }                } @@ -3468,7 +3468,7 @@ static long bt_regexec_both(char_u *line,          || (ireg_ic              && (((enc_utf8 && utf_fold(prog->regstart) == utf_fold(c)))                  || (c < 255 && prog->regstart < 255 -                    && vim_tolower(prog->regstart) == vim_tolower(c))))) { +                    && mb_tolower(prog->regstart) == mb_tolower(c))))) {        retval = regtry(prog, col);      } else {        retval = 0; @@ -4143,7 +4143,7 @@ regmatch (            if (*opnd != *reginput                && (!ireg_ic                    || (!enc_utf8 -                      && vim_tolower(*opnd) != vim_tolower(*reginput)))) { +                      && mb_tolower(*opnd) != mb_tolower(*reginput)))) {              status = RA_NOMATCH;            } else if (*opnd == NUL) {              // match empty string always works; happens when "~" is @@ -4561,12 +4561,14 @@ regmatch (            if (OP(next) == EXACTLY) {              rst.nextb = *OPERAND(next);              if (ireg_ic) { -              if (vim_isupper(rst.nextb)) -                rst.nextb_ic = vim_tolower(rst.nextb); -              else -                rst.nextb_ic = vim_toupper(rst.nextb); -            } else +              if (mb_isupper(rst.nextb)) { +                rst.nextb_ic = mb_tolower(rst.nextb); +              } else { +                rst.nextb_ic = mb_toupper(rst.nextb); +              } +            } else {                rst.nextb_ic = rst.nextb; +            }            } else {              rst.nextb = NUL;              rst.nextb_ic = NUL; @@ -5327,8 +5329,8 @@ do_class:       * would have been used for it.  It does handle single-byte       * characters, such as latin1. */      if (ireg_ic) { -      cu = vim_toupper(*opnd); -      cl = vim_tolower(*opnd); +      cu = mb_toupper(*opnd); +      cl = mb_tolower(*opnd);        while (count < maxcount && (*scan == cu || *scan == cl)) {          count++;          scan++; @@ -6330,28 +6332,28 @@ static inline char_u *cstrchr(const char_u *const s, const int c)  static fptr_T do_upper(int *d, int c)  { -  *d = vim_toupper(c); +  *d = mb_toupper(c);    return (fptr_T)NULL;  }  static fptr_T do_Upper(int *d, int c)  { -  *d = vim_toupper(c); +  *d = mb_toupper(c);    return (fptr_T)do_Upper;  }  static fptr_T do_lower(int *d, int c)  { -  *d = vim_tolower(c); +  *d = mb_tolower(c);    return (fptr_T)NULL;  }  static fptr_T do_Lower(int *d, int c)  { -  *d = vim_tolower(c); +  *d = mb_tolower(c);    return (fptr_T)do_Lower;  }  | 
