mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 00:08:19 +00:00
remove MB_{IS,TO}{UPPER,LOWER}
This commit is contained in:
@@ -222,8 +222,8 @@ int buf_init_chartab(buf_T *buf, int global)
|
|||||||
// work properly when 'encoding' is "latin1" and the locale is
|
// work properly when 'encoding' is "latin1" and the locale is
|
||||||
// "C".
|
// "C".
|
||||||
if (!do_isalpha
|
if (!do_isalpha
|
||||||
|| MB_ISLOWER(c)
|
|| vim_islower(c)
|
||||||
|| MB_ISUPPER(c)
|
|| vim_isupper(c)
|
||||||
|| (p_altkeymap && (F_isalpha(c) || F_isdigit(c)))) {
|
|| (p_altkeymap && (F_isalpha(c) || F_isdigit(c)))) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
// (re)set ID flag
|
// (re)set ID flag
|
||||||
|
22
src/edit.c
22
src/edit.c
@@ -2002,12 +2002,12 @@ int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int
|
|||||||
c = mb_ptr2char_adv(&p);
|
c = mb_ptr2char_adv(&p);
|
||||||
else
|
else
|
||||||
c = *(p++);
|
c = *(p++);
|
||||||
if (MB_ISLOWER(c)) {
|
if (vim_islower(c)) {
|
||||||
has_lower = TRUE;
|
has_lower = TRUE;
|
||||||
if (MB_ISUPPER(wca[i])) {
|
if (vim_isupper(wca[i])) {
|
||||||
/* Rule 1 is satisfied. */
|
/* Rule 1 is satisfied. */
|
||||||
for (i = actual_compl_length; i < actual_len; ++i)
|
for (i = actual_compl_length; i < actual_len; ++i)
|
||||||
wca[i] = MB_TOLOWER(wca[i]);
|
wca[i] = vim_tolower(wca[i]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2024,13 +2024,13 @@ int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int
|
|||||||
c = mb_ptr2char_adv(&p);
|
c = mb_ptr2char_adv(&p);
|
||||||
else
|
else
|
||||||
c = *(p++);
|
c = *(p++);
|
||||||
if (was_letter && MB_ISUPPER(c) && MB_ISLOWER(wca[i])) {
|
if (was_letter && vim_isupper(c) && vim_islower(wca[i])) {
|
||||||
/* Rule 2 is satisfied. */
|
/* Rule 2 is satisfied. */
|
||||||
for (i = actual_compl_length; i < actual_len; ++i)
|
for (i = actual_compl_length; i < actual_len; ++i)
|
||||||
wca[i] = MB_TOUPPER(wca[i]);
|
wca[i] = vim_toupper(wca[i]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
was_letter = MB_ISLOWER(c) || MB_ISUPPER(c);
|
was_letter = vim_islower(c) || vim_isupper(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2041,10 +2041,10 @@ int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int
|
|||||||
c = mb_ptr2char_adv(&p);
|
c = mb_ptr2char_adv(&p);
|
||||||
else
|
else
|
||||||
c = *(p++);
|
c = *(p++);
|
||||||
if (MB_ISLOWER(c))
|
if (vim_islower(c))
|
||||||
wca[i] = MB_TOLOWER(wca[i]);
|
wca[i] = vim_tolower(wca[i]);
|
||||||
else if (MB_ISUPPER(c))
|
else if (vim_isupper(c))
|
||||||
wca[i] = MB_TOUPPER(wca[i]);
|
wca[i] = vim_toupper(wca[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2231,7 +2231,7 @@ static void ins_compl_longest_match(compl_T *match)
|
|||||||
c1 = *p;
|
c1 = *p;
|
||||||
c2 = *s;
|
c2 = *s;
|
||||||
}
|
}
|
||||||
if (match->cp_icase ? (MB_TOLOWER(c1) != MB_TOLOWER(c2))
|
if (match->cp_icase ? (vim_tolower(c1) != vim_tolower(c2))
|
||||||
: (c1 != c2))
|
: (c1 != c2))
|
||||||
break;
|
break;
|
||||||
if (has_mbyte) {
|
if (has_mbyte) {
|
||||||
|
@@ -1146,7 +1146,7 @@ getcmdline (
|
|||||||
* command line has no uppercase characters, convert
|
* command line has no uppercase characters, convert
|
||||||
* the character to lowercase */
|
* the character to lowercase */
|
||||||
if (p_ic && p_scs && !pat_has_uppercase(ccline.cmdbuff))
|
if (p_ic && p_scs && !pat_has_uppercase(ccline.cmdbuff))
|
||||||
c = MB_TOLOWER(c);
|
c = vim_tolower(c);
|
||||||
if (c != NUL) {
|
if (c != NUL) {
|
||||||
if (c == firstc || vim_strchr((char_u *)(
|
if (c == firstc || vim_strchr((char_u *)(
|
||||||
p_magic ? "\\^$.*[" : "\\^$"), c)
|
p_magic ? "\\^$.*[" : "\\^$"), c)
|
||||||
|
@@ -1123,7 +1123,7 @@ static int ff_wc_equal(char_u *s1, char_u *s2)
|
|||||||
int c1 = PTR2CHAR(s1 + i);
|
int c1 = PTR2CHAR(s1 + i);
|
||||||
int c2 = PTR2CHAR(s2 + i);
|
int c2 = PTR2CHAR(s2 + i);
|
||||||
|
|
||||||
if ((p_fic ? MB_TOLOWER(c1) != MB_TOLOWER(c2) : c1 != c2)
|
if ((p_fic ? vim_tolower(c1) != vim_tolower(c2) : c1 != c2)
|
||||||
&& (prev1 != '*' || prev2 != '*'))
|
&& (prev1 != '*' || prev2 != '*'))
|
||||||
return FAIL;
|
return FAIL;
|
||||||
prev2 = prev1;
|
prev2 = prev1;
|
||||||
|
11
src/macros.h
11
src/macros.h
@@ -51,7 +51,7 @@
|
|||||||
* characters, first use islower() or isupper() then.
|
* characters, first use islower() or isupper() then.
|
||||||
* Careful: Only call TOUPPER_LOC() and TOLOWER_LOC() with a character in the
|
* Careful: Only call TOUPPER_LOC() and TOLOWER_LOC() with a character in the
|
||||||
* range 0 - 255. toupper()/tolower() on some systems can't handle others.
|
* range 0 - 255. toupper()/tolower() on some systems can't handle others.
|
||||||
* Note: It is often better to use MB_TOLOWER() and MB_TOUPPER(), because many
|
* Note: It is often better to use vim_tolower() and vim_toupper(), because many
|
||||||
* toupper() and tolower() implementations only work for ASCII.
|
* toupper() and tolower() implementations only work for ASCII.
|
||||||
*/
|
*/
|
||||||
# ifdef BROKEN_TOUPPER
|
# ifdef BROKEN_TOUPPER
|
||||||
@@ -66,15 +66,6 @@
|
|||||||
# define TOUPPER_ASC(c) (((c) < 'a' || (c) > 'z') ? (c) : (c) - ('a' - 'A'))
|
# define TOUPPER_ASC(c) (((c) < 'a' || (c) > 'z') ? (c) : (c) - ('a' - 'A'))
|
||||||
# define TOLOWER_ASC(c) (((c) < 'A' || (c) > 'Z') ? (c) : (c) + ('a' - 'A'))
|
# define TOLOWER_ASC(c) (((c) < 'A' || (c) > 'Z') ? (c) : (c) + ('a' - 'A'))
|
||||||
|
|
||||||
/*
|
|
||||||
* MB_ISLOWER() and MB_ISUPPER() are to be used on multi-byte characters. But
|
|
||||||
* don't use them for negative values!
|
|
||||||
*/
|
|
||||||
# define MB_ISLOWER(c) vim_islower(c)
|
|
||||||
# define MB_ISUPPER(c) vim_isupper(c)
|
|
||||||
# define MB_TOLOWER(c) vim_tolower(c)
|
|
||||||
# define MB_TOUPPER(c) vim_toupper(c)
|
|
||||||
|
|
||||||
/* Use our own isdigit() replacement, because on MS-Windows isdigit() returns
|
/* Use our own isdigit() replacement, because on MS-Windows isdigit() returns
|
||||||
* non-zero for superscript 1. Also avoids that isdigit() crashes for numbers
|
* non-zero for superscript 1. Also avoids that isdigit() crashes for numbers
|
||||||
* below 0 and above 255. */
|
* below 0 and above 255. */
|
||||||
|
@@ -2868,7 +2868,7 @@ int mb_strnicmp(char_u *s1, char_u *s2, size_t nn)
|
|||||||
if (l <= 1) {
|
if (l <= 1) {
|
||||||
/* Single byte: first check normally, then with ignore case. */
|
/* Single byte: first check normally, then with ignore case. */
|
||||||
if (s1[i] != s2[i]) {
|
if (s1[i] != s2[i]) {
|
||||||
cdiff = MB_TOLOWER(s1[i]) - MB_TOLOWER(s2[i]);
|
cdiff = vim_tolower(s1[i]) - vim_tolower(s2[i]);
|
||||||
if (cdiff != 0)
|
if (cdiff != 0)
|
||||||
return cdiff;
|
return cdiff;
|
||||||
}
|
}
|
||||||
|
@@ -2772,7 +2772,7 @@ do_dialog (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Make the character lowercase, as chars in "hotkeys" are. */
|
/* Make the character lowercase, as chars in "hotkeys" are. */
|
||||||
c = MB_TOLOWER(c);
|
c = vim_tolower(c);
|
||||||
retval = 1;
|
retval = 1;
|
||||||
for (i = 0; hotkeys[i]; ++i) {
|
for (i = 0; hotkeys[i]; ++i) {
|
||||||
if (has_mbyte) {
|
if (has_mbyte) {
|
||||||
@@ -2820,7 +2820,7 @@ copy_char (
|
|||||||
|
|
||||||
if (has_mbyte) {
|
if (has_mbyte) {
|
||||||
if (lowercase) {
|
if (lowercase) {
|
||||||
c = MB_TOLOWER((*mb_ptr2char)(from));
|
c = vim_tolower((*mb_ptr2char)(from));
|
||||||
return (*mb_char2bytes)(c, to);
|
return (*mb_char2bytes)(c, to);
|
||||||
} else {
|
} else {
|
||||||
len = (*mb_ptr2len)(from);
|
len = (*mb_ptr2len)(from);
|
||||||
|
10
src/ops.c
10
src/ops.c
@@ -2032,16 +2032,16 @@ int swapchar(int op_type, pos_T *pos)
|
|||||||
if (enc_dbcs != 0 && c >= 0x100) /* No lower/uppercase letter */
|
if (enc_dbcs != 0 && c >= 0x100) /* No lower/uppercase letter */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
nc = c;
|
nc = c;
|
||||||
if (MB_ISLOWER(c)) {
|
if (vim_islower(c)) {
|
||||||
if (op_type == OP_ROT13)
|
if (op_type == OP_ROT13)
|
||||||
nc = ROT13(c, 'a');
|
nc = ROT13(c, 'a');
|
||||||
else if (op_type != OP_LOWER)
|
else if (op_type != OP_LOWER)
|
||||||
nc = MB_TOUPPER(c);
|
nc = vim_toupper(c);
|
||||||
} else if (MB_ISUPPER(c)) {
|
} else if (vim_isupper(c)) {
|
||||||
if (op_type == OP_ROT13)
|
if (op_type == OP_ROT13)
|
||||||
nc = ROT13(c, 'A');
|
nc = ROT13(c, 'A');
|
||||||
else if (op_type != OP_UPPER)
|
else if (op_type != OP_UPPER)
|
||||||
nc = MB_TOLOWER(c);
|
nc = vim_tolower(c);
|
||||||
}
|
}
|
||||||
if (nc != c) {
|
if (nc != c) {
|
||||||
if (enc_utf8 && (c >= 0x80 || nc >= 0x80)) {
|
if (enc_utf8 && (c >= 0x80 || nc >= 0x80)) {
|
||||||
@@ -3289,7 +3289,7 @@ void ex_display(exarg_T *eap)
|
|||||||
} else
|
} else
|
||||||
yb = &(y_regs[i]);
|
yb = &(y_regs[i]);
|
||||||
|
|
||||||
if (name == MB_TOLOWER(redir_reg)
|
if (name == vim_tolower(redir_reg)
|
||||||
|| (redir_reg == '"' && yb == y_previous))
|
|| (redir_reg == '"' && yb == y_previous))
|
||||||
continue; /* do not list register being written to, the
|
continue; /* do not list register being written to, the
|
||||||
* pointer can be freed */
|
* pointer can be freed */
|
||||||
|
@@ -246,7 +246,7 @@ int vim_fnamencmp(char_u *x, char_u *y, size_t len)
|
|||||||
cx = PTR2CHAR(px);
|
cx = PTR2CHAR(px);
|
||||||
cy = PTR2CHAR(py);
|
cy = PTR2CHAR(py);
|
||||||
if (cx == NUL || cy == NUL
|
if (cx == NUL || cy == NUL
|
||||||
|| ((p_fic ? MB_TOLOWER(cx) != MB_TOLOWER(cy) : cx != cy)
|
|| ((p_fic ? vim_tolower(cx) != vim_tolower(cy) : cx != cy)
|
||||||
&& !(cx == '/' && cy == '\\')
|
&& !(cx == '/' && cy == '\\')
|
||||||
&& !(cx == '\\' && cy == '/')))
|
&& !(cx == '\\' && cy == '/')))
|
||||||
break;
|
break;
|
||||||
@@ -1679,7 +1679,7 @@ int pathcmp(const char *p, const char *q, int maxlen)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((p_fic ? MB_TOUPPER(c1) != MB_TOUPPER(c2) : c1 != c2)
|
if ((p_fic ? vim_toupper(c1) != vim_toupper(c2) : c1 != c2)
|
||||||
#ifdef BACKSLASH_IN_FILENAME
|
#ifdef BACKSLASH_IN_FILENAME
|
||||||
/* consider '/' and '\\' to be equal */
|
/* consider '/' and '\\' to be equal */
|
||||||
&& !((c1 == '/' && c2 == '\\')
|
&& !((c1 == '/' && c2 == '\\')
|
||||||
@@ -1690,7 +1690,7 @@ int pathcmp(const char *p, const char *q, int maxlen)
|
|||||||
return -1;
|
return -1;
|
||||||
if (vim_ispathsep(c2))
|
if (vim_ispathsep(c2))
|
||||||
return 1;
|
return 1;
|
||||||
return p_fic ? MB_TOUPPER(c1) - MB_TOUPPER(c2)
|
return p_fic ? vim_toupper(c1) - vim_toupper(c2)
|
||||||
: c1 - c2; /* no match */
|
: c1 - c2; /* no match */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
34
src/regexp.c
34
src/regexp.c
@@ -2289,7 +2289,7 @@ collection:
|
|||||||
break;
|
break;
|
||||||
case CLASS_LOWER:
|
case CLASS_LOWER:
|
||||||
for (cu = 1; cu <= 255; cu++)
|
for (cu = 1; cu <= 255; cu++)
|
||||||
if (MB_ISLOWER(cu))
|
if (vim_islower(cu))
|
||||||
regc(cu);
|
regc(cu);
|
||||||
break;
|
break;
|
||||||
case CLASS_PRINT:
|
case CLASS_PRINT:
|
||||||
@@ -2309,7 +2309,7 @@ collection:
|
|||||||
break;
|
break;
|
||||||
case CLASS_UPPER:
|
case CLASS_UPPER:
|
||||||
for (cu = 1; cu <= 255; cu++)
|
for (cu = 1; cu <= 255; cu++)
|
||||||
if (MB_ISUPPER(cu))
|
if (vim_isupper(cu))
|
||||||
regc(cu);
|
regc(cu);
|
||||||
break;
|
break;
|
||||||
case CLASS_XDIGIT:
|
case CLASS_XDIGIT:
|
||||||
@@ -3513,7 +3513,7 @@ proftime_T *tm; /* timeout limit or NULL */
|
|||||||
|| (ireg_ic && ((
|
|| (ireg_ic && ((
|
||||||
(enc_utf8 && utf_fold(prog->regstart) == utf_fold(c)))
|
(enc_utf8 && utf_fold(prog->regstart) == utf_fold(c)))
|
||||||
|| (c < 255 && prog->regstart < 255 &&
|
|| (c < 255 && prog->regstart < 255 &&
|
||||||
MB_TOLOWER(prog->regstart) == MB_TOLOWER(c)))))
|
vim_tolower(prog->regstart) == vim_tolower(c)))))
|
||||||
retval = regtry(prog, col);
|
retval = regtry(prog, col);
|
||||||
else
|
else
|
||||||
retval = 0;
|
retval = 0;
|
||||||
@@ -4186,7 +4186,7 @@ regmatch (
|
|||||||
if (*opnd != *reginput
|
if (*opnd != *reginput
|
||||||
&& (!ireg_ic || (
|
&& (!ireg_ic || (
|
||||||
!enc_utf8 &&
|
!enc_utf8 &&
|
||||||
MB_TOLOWER(*opnd) != MB_TOLOWER(*reginput))))
|
vim_tolower(*opnd) != vim_tolower(*reginput))))
|
||||||
status = RA_NOMATCH;
|
status = RA_NOMATCH;
|
||||||
else if (*opnd == NUL) {
|
else if (*opnd == NUL) {
|
||||||
/* match empty string always works; happens when "~" is
|
/* match empty string always works; happens when "~" is
|
||||||
@@ -4598,10 +4598,10 @@ regmatch (
|
|||||||
if (OP(next) == EXACTLY) {
|
if (OP(next) == EXACTLY) {
|
||||||
rst.nextb = *OPERAND(next);
|
rst.nextb = *OPERAND(next);
|
||||||
if (ireg_ic) {
|
if (ireg_ic) {
|
||||||
if (MB_ISUPPER(rst.nextb))
|
if (vim_isupper(rst.nextb))
|
||||||
rst.nextb_ic = MB_TOLOWER(rst.nextb);
|
rst.nextb_ic = vim_tolower(rst.nextb);
|
||||||
else
|
else
|
||||||
rst.nextb_ic = MB_TOUPPER(rst.nextb);
|
rst.nextb_ic = vim_toupper(rst.nextb);
|
||||||
} else
|
} else
|
||||||
rst.nextb_ic = rst.nextb;
|
rst.nextb_ic = rst.nextb;
|
||||||
} else {
|
} else {
|
||||||
@@ -5367,8 +5367,8 @@ do_class:
|
|||||||
* would have been used for it. It does handle single-byte
|
* would have been used for it. It does handle single-byte
|
||||||
* characters, such as latin1. */
|
* characters, such as latin1. */
|
||||||
if (ireg_ic) {
|
if (ireg_ic) {
|
||||||
cu = MB_TOUPPER(*opnd);
|
cu = vim_toupper(*opnd);
|
||||||
cl = MB_TOLOWER(*opnd);
|
cl = vim_tolower(*opnd);
|
||||||
while (count < maxcount && (*scan == cu || *scan == cl)) {
|
while (count < maxcount && (*scan == cu || *scan == cl)) {
|
||||||
count++;
|
count++;
|
||||||
scan++;
|
scan++;
|
||||||
@@ -6342,10 +6342,10 @@ static char_u *cstrchr(char_u *s, int c)
|
|||||||
* For UTF-8 need to use folded case. */
|
* For UTF-8 need to use folded case. */
|
||||||
if (enc_utf8 && c > 0x80)
|
if (enc_utf8 && c > 0x80)
|
||||||
cc = utf_fold(c);
|
cc = utf_fold(c);
|
||||||
else if (MB_ISUPPER(c))
|
else if (vim_isupper(c))
|
||||||
cc = MB_TOLOWER(c);
|
cc = vim_tolower(c);
|
||||||
else if (MB_ISLOWER(c))
|
else if (vim_islower(c))
|
||||||
cc = MB_TOUPPER(c);
|
cc = vim_toupper(c);
|
||||||
else
|
else
|
||||||
return vim_strchr(s, c);
|
return vim_strchr(s, c);
|
||||||
|
|
||||||
@@ -6393,7 +6393,7 @@ static fptr_T do_upper(d, c)
|
|||||||
int *d;
|
int *d;
|
||||||
int c;
|
int c;
|
||||||
{
|
{
|
||||||
*d = MB_TOUPPER(c);
|
*d = vim_toupper(c);
|
||||||
|
|
||||||
return (fptr_T)NULL;
|
return (fptr_T)NULL;
|
||||||
}
|
}
|
||||||
@@ -6402,7 +6402,7 @@ static fptr_T do_Upper(d, c)
|
|||||||
int *d;
|
int *d;
|
||||||
int c;
|
int c;
|
||||||
{
|
{
|
||||||
*d = MB_TOUPPER(c);
|
*d = vim_toupper(c);
|
||||||
|
|
||||||
return (fptr_T)do_Upper;
|
return (fptr_T)do_Upper;
|
||||||
}
|
}
|
||||||
@@ -6411,7 +6411,7 @@ static fptr_T do_lower(d, c)
|
|||||||
int *d;
|
int *d;
|
||||||
int c;
|
int c;
|
||||||
{
|
{
|
||||||
*d = MB_TOLOWER(c);
|
*d = vim_tolower(c);
|
||||||
|
|
||||||
return (fptr_T)NULL;
|
return (fptr_T)NULL;
|
||||||
}
|
}
|
||||||
@@ -6420,7 +6420,7 @@ static fptr_T do_Lower(d, c)
|
|||||||
int *d;
|
int *d;
|
||||||
int c;
|
int c;
|
||||||
{
|
{
|
||||||
*d = MB_TOLOWER(c);
|
*d = vim_tolower(c);
|
||||||
|
|
||||||
return (fptr_T)do_Lower;
|
return (fptr_T)do_Lower;
|
||||||
}
|
}
|
||||||
|
@@ -4278,7 +4278,7 @@ static int check_char_class(int class, int c)
|
|||||||
return OK;
|
return OK;
|
||||||
break;
|
break;
|
||||||
case NFA_CLASS_LOWER:
|
case NFA_CLASS_LOWER:
|
||||||
if (MB_ISLOWER(c))
|
if (vim_islower(c))
|
||||||
return OK;
|
return OK;
|
||||||
break;
|
break;
|
||||||
case NFA_CLASS_PRINT:
|
case NFA_CLASS_PRINT:
|
||||||
@@ -4294,7 +4294,7 @@ static int check_char_class(int class, int c)
|
|||||||
return OK;
|
return OK;
|
||||||
break;
|
break;
|
||||||
case NFA_CLASS_UPPER:
|
case NFA_CLASS_UPPER:
|
||||||
if (MB_ISUPPER(c))
|
if (vim_isupper(c))
|
||||||
return OK;
|
return OK;
|
||||||
break;
|
break;
|
||||||
case NFA_CLASS_XDIGIT:
|
case NFA_CLASS_XDIGIT:
|
||||||
@@ -4803,7 +4803,7 @@ static long find_match_text(colnr_T startcol, int regstart, char_u *match_text)
|
|||||||
for (len1 = 0; match_text[len1] != NUL; len1 += MB_CHAR2LEN(c1)) {
|
for (len1 = 0; match_text[len1] != NUL; len1 += MB_CHAR2LEN(c1)) {
|
||||||
c1 = PTR2CHAR(match_text + len1);
|
c1 = PTR2CHAR(match_text + len1);
|
||||||
c2 = PTR2CHAR(regline + col + len2);
|
c2 = PTR2CHAR(regline + col + len2);
|
||||||
if (c1 != c2 && (!ireg_ic || MB_TOLOWER(c1) != MB_TOLOWER(c2))) {
|
if (c1 != c2 && (!ireg_ic || vim_tolower(c1) != vim_tolower(c2))) {
|
||||||
match = FALSE;
|
match = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -5462,11 +5462,11 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *subm
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (ireg_ic) {
|
if (ireg_ic) {
|
||||||
int curc_low = MB_TOLOWER(curc);
|
int curc_low = vim_tolower(curc);
|
||||||
int done = FALSE;
|
int done = FALSE;
|
||||||
|
|
||||||
for (; c1 <= c2; ++c1)
|
for (; c1 <= c2; ++c1)
|
||||||
if (MB_TOLOWER(c1) == curc_low) {
|
if (vim_tolower(c1) == curc_low) {
|
||||||
result = result_if_matched;
|
result = result_if_matched;
|
||||||
done = TRUE;
|
done = TRUE;
|
||||||
break;
|
break;
|
||||||
@@ -5476,8 +5476,8 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *subm
|
|||||||
}
|
}
|
||||||
} else if (state->c < 0 ? check_char_class(state->c, curc)
|
} else if (state->c < 0 ? check_char_class(state->c, curc)
|
||||||
: (curc == state->c
|
: (curc == state->c
|
||||||
|| (ireg_ic && MB_TOLOWER(curc)
|
|| (ireg_ic && vim_tolower(curc)
|
||||||
== MB_TOLOWER(state->c)))) {
|
== vim_tolower(state->c)))) {
|
||||||
result = result_if_matched;
|
result = result_if_matched;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -5838,7 +5838,7 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *subm
|
|||||||
result = (c == curc);
|
result = (c == curc);
|
||||||
|
|
||||||
if (!result && ireg_ic)
|
if (!result && ireg_ic)
|
||||||
result = MB_TOLOWER(c) == MB_TOLOWER(curc);
|
result = vim_tolower(c) == vim_tolower(curc);
|
||||||
/* If there is a composing character which is not being
|
/* If there is a composing character which is not being
|
||||||
* ignored there can be no match. Match with composing
|
* ignored there can be no match. Match with composing
|
||||||
* character uses NFA_COMPOSING above. */
|
* character uses NFA_COMPOSING above. */
|
||||||
@@ -5985,8 +5985,8 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *subm
|
|||||||
/* Checking if the required start character matches is
|
/* Checking if the required start character matches is
|
||||||
* cheaper than adding a state that won't match. */
|
* cheaper than adding a state that won't match. */
|
||||||
c = PTR2CHAR(reginput + clen);
|
c = PTR2CHAR(reginput + clen);
|
||||||
if (c != prog->regstart && (!ireg_ic || MB_TOLOWER(c)
|
if (c != prog->regstart && (!ireg_ic || vim_tolower(c)
|
||||||
!= MB_TOLOWER(prog->regstart))) {
|
!= vim_tolower(prog->regstart))) {
|
||||||
#ifdef ENABLE_LOG
|
#ifdef ENABLE_LOG
|
||||||
fprintf(log_fd,
|
fprintf(log_fd,
|
||||||
" Skipping start state, regstart does not match\n");
|
" Skipping start state, regstart does not match\n");
|
||||||
|
@@ -365,7 +365,7 @@ int pat_has_uppercase(char_u *pat)
|
|||||||
p += 2;
|
p += 2;
|
||||||
else
|
else
|
||||||
p += 1;
|
p += 1;
|
||||||
} else if (MB_ISUPPER(*p))
|
} else if (vim_isupper(*p))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
else
|
else
|
||||||
++p;
|
++p;
|
||||||
|
@@ -8685,13 +8685,13 @@ void init_spell_chartab(void)
|
|||||||
} else {
|
} else {
|
||||||
/* Rough guess: use locale-dependent library functions. */
|
/* Rough guess: use locale-dependent library functions. */
|
||||||
for (i = 128; i < 256; ++i) {
|
for (i = 128; i < 256; ++i) {
|
||||||
if (MB_ISUPPER(i)) {
|
if (vim_isupper(i)) {
|
||||||
spelltab.st_isw[i] = TRUE;
|
spelltab.st_isw[i] = TRUE;
|
||||||
spelltab.st_isu[i] = TRUE;
|
spelltab.st_isu[i] = TRUE;
|
||||||
spelltab.st_fold[i] = MB_TOLOWER(i);
|
spelltab.st_fold[i] = vim_tolower(i);
|
||||||
} else if (MB_ISLOWER(i)) {
|
} else if (vim_islower(i)) {
|
||||||
spelltab.st_isw[i] = TRUE;
|
spelltab.st_isw[i] = TRUE;
|
||||||
spelltab.st_upper[i] = MB_TOUPPER(i);
|
spelltab.st_upper[i] = vim_toupper(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user