aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ascii.h12
-rw-r--r--src/nvim/charset.c2
-rw-r--r--src/nvim/diff.c16
-rw-r--r--src/nvim/edit.c30
-rw-r--r--src/nvim/eval.c14
-rw-r--r--src/nvim/ex_cmds.c16
-rw-r--r--src/nvim/ex_cmds2.c2
-rw-r--r--src/nvim/ex_docmd.c22
-rw-r--r--src/nvim/fileio.c20
-rw-r--r--src/nvim/fold.c8
-rw-r--r--src/nvim/getchar.c8
-rw-r--r--src/nvim/if_cscope.c2
-rw-r--r--src/nvim/indent.c18
-rw-r--r--src/nvim/indent_c.c16
-rw-r--r--src/nvim/mbyte.c2
-rw-r--r--src/nvim/menu.c24
-rw-r--r--src/nvim/message.c2
-rw-r--r--src/nvim/misc1.c40
-rw-r--r--src/nvim/normal.c14
-rw-r--r--src/nvim/ops.c16
-rw-r--r--src/nvim/option.c16
-rw-r--r--src/nvim/os_unix.c2
-rw-r--r--src/nvim/quickfix.c2
-rw-r--r--src/nvim/regexp.c4
-rw-r--r--src/nvim/regexp_nfa.c4
-rw-r--r--src/nvim/screen.c4
-rw-r--r--src/nvim/search.c24
-rw-r--r--src/nvim/spell.c16
-rw-r--r--src/nvim/strings.c2
-rw-r--r--src/nvim/syntax.c22
-rw-r--r--src/nvim/tag.c2
-rw-r--r--src/nvim/vim.h6
32 files changed, 197 insertions, 191 deletions
diff --git a/src/nvim/ascii.h b/src/nvim/ascii.h
index d9d9eac04d..82562b9aa5 100644
--- a/src/nvim/ascii.h
+++ b/src/nvim/ascii.h
@@ -8,6 +8,9 @@
#ifndef NVIM_ASCII_H
#define NVIM_ASCII_H
+#include <stdbool.h>
+#include "func_attr.h"
+
// Definitions of various common control characters.
#define CharOrd(x) ((x) < 'a' ? (x) - 'A' : (x) - 'a')
@@ -87,4 +90,13 @@
# define PATHSEPSTR "/"
#endif
+static inline bool ascii_iswhite(int c) FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_CONST;
+
+/// ascii_iswhite() is used for "^" and the like. It differs from isspace()
+/// because it doesn't include <CR> and <LF> and the like.
+static inline bool ascii_iswhite(int c)
+{
+ return c == ' ' || c == '\t';
+}
+
#endif /* NVIM_ASCII_H */
diff --git a/src/nvim/charset.c b/src/nvim/charset.c
index 4633bacb78..55dee08090 100644
--- a/src/nvim/charset.c
+++ b/src/nvim/charset.c
@@ -1407,7 +1407,7 @@ void getvcols(win_T *wp, pos_T *pos1, pos_T *pos2, colnr_T *left,
char_u* skipwhite(char_u *q)
{
char_u *p = q;
- while (vim_iswhite(*p)) {
+ while (ascii_iswhite(*p)) {
// skip to next non-white
p++;
}
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index 88d63b3383..42965a7139 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -1590,7 +1590,7 @@ static int diff_cmp(char_u *s1, char_u *s2)
char_u *p2 = s2;
while (*p1 != NUL && *p2 != NUL) {
- if (vim_iswhite(*p1) && vim_iswhite(*p2)) {
+ if (ascii_iswhite(*p1) && ascii_iswhite(*p2)) {
p1 = skipwhite(p1);
p2 = skipwhite(p2);
} else {
@@ -1897,8 +1897,8 @@ int diff_find_change(win_T *wp, linenr_T lnum, int *startp, int *endp)
while (line_org[si_org] != NUL) {
if ((diff_flags & DIFF_IWHITE)
- && vim_iswhite(line_org[si_org])
- && vim_iswhite(line_new[si_new])) {
+ && ascii_iswhite(line_org[si_org])
+ && ascii_iswhite(line_new[si_new])) {
si_org = (int)(skipwhite(line_org + si_org) - line_org);
si_new = (int)(skipwhite(line_new + si_new) - line_new);
} else {
@@ -1931,13 +1931,13 @@ int diff_find_change(win_T *wp, linenr_T lnum, int *startp, int *endp)
&& ei_org >= 0
&& ei_new >= 0) {
if ((diff_flags & DIFF_IWHITE)
- && vim_iswhite(line_org[ei_org])
- && vim_iswhite(line_new[ei_new])) {
- while (ei_org >= *startp && vim_iswhite(line_org[ei_org])) {
+ && ascii_iswhite(line_org[ei_org])
+ && ascii_iswhite(line_new[ei_new])) {
+ while (ei_org >= *startp && ascii_iswhite(line_org[ei_org])) {
ei_org--;
}
- while (ei_new >= si_new && vim_iswhite(line_new[ei_new])) {
+ while (ei_new >= si_new && ascii_iswhite(line_new[ei_new])) {
ei_new--;
}
} else {
@@ -2108,7 +2108,7 @@ void ex_diffgetput(exarg_T *eap)
} else {
// Buffer number or pattern given. Ignore trailing white space.
p = eap->arg + STRLEN(eap->arg);
- while (p > eap->arg && vim_iswhite(p[-1])) {
+ while (p > eap->arg && ascii_iswhite(p[-1])) {
p--;
}
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index a04f393825..9d475849cf 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -1662,7 +1662,7 @@ void truncate_spaces(char_u *line)
int i;
/* find start of trailing white space */
- for (i = (int)STRLEN(line) - 1; i >= 0 && vim_iswhite(line[i]); i--) {
+ for (i = (int)STRLEN(line) - 1; i >= 0 && ascii_iswhite(line[i]); i--) {
if (State & REPLACE_FLAG)
replace_join(0); /* remove a NUL from the replace stack */
}
@@ -1838,7 +1838,7 @@ static int ins_compl_accept_char(int c)
case CTRL_X_OMNI:
/* Command line and Omni completion can work with just about any
* printable character, but do stop at white space. */
- return vim_isprintc(c) && !vim_iswhite(c);
+ return vim_isprintc(c) && !ascii_iswhite(c);
case CTRL_X_WHOLE_LINE:
/* For while line completion a space can be part of the line. */
@@ -4824,7 +4824,7 @@ insert_special (
*/
# define ISSPECIAL(c) ((c) < ' ' || (c) >= DEL || (c) == '0' || (c) == '^')
-# define WHITECHAR(cc) (vim_iswhite(cc) && \
+# define WHITECHAR(cc) (ascii_iswhite(cc) && \
(!enc_utf8 || \
!utf_iscomposing( \
utf_ptr2char(get_cursor_pos_ptr() + 1))))
@@ -4870,7 +4870,7 @@ insertchar (
*/
if (textwidth > 0
&& ((flags & INSCHAR_FORMAT)
- || (!vim_iswhite(c)
+ || (!ascii_iswhite(c)
&& !((State & REPLACE_FLAG)
&& !(State & VREPLACE_FLAG)
&& *get_cursor_pos_ptr() != NUL)
@@ -4915,7 +4915,7 @@ insertchar (
++p;
middle_len = copy_option_part(&p, lead_end, COM_MAX_LEN, ",");
/* Don't count trailing white space for middle_len */
- while (middle_len > 0 && vim_iswhite(lead_end[middle_len - 1]))
+ while (middle_len > 0 && ascii_iswhite(lead_end[middle_len - 1]))
--middle_len;
/* Find the end-comment string */
@@ -4925,7 +4925,7 @@ insertchar (
/* Skip white space before the cursor */
i = curwin->w_cursor.col;
- while (--i >= 0 && vim_iswhite(line[i]))
+ while (--i >= 0 && ascii_iswhite(line[i]))
;
i++;
@@ -5071,7 +5071,7 @@ internal_format (
&& !(State & VREPLACE_FLAG)
) {
cc = gchar_cursor();
- if (vim_iswhite(cc)) {
+ if (ascii_iswhite(cc)) {
save_char = cc;
pchar_cursor('x');
}
@@ -5682,13 +5682,13 @@ stop_insert (
if (curwin->w_cursor.col > 0 && gchar_cursor() == NUL) {
dec_cursor();
cc = gchar_cursor();
- if (!vim_iswhite(cc))
+ if (!ascii_iswhite(cc))
curwin->w_cursor = tpos;
}
auto_format(TRUE, FALSE);
- if (vim_iswhite(cc)) {
+ if (ascii_iswhite(cc)) {
if (gchar_cursor() != NUL)
inc_cursor();
/* If the cursor is still at the same character, also keep
@@ -5720,7 +5720,7 @@ stop_insert (
if (gchar_cursor() == NUL && curwin->w_cursor.col > 0)
--curwin->w_cursor.col;
cc = gchar_cursor();
- if (!vim_iswhite(cc))
+ if (!ascii_iswhite(cc))
break;
if (del_char(TRUE) == FAIL)
break; /* should not happen */
@@ -5836,7 +5836,7 @@ void beginline(int flags)
if (flags & (BL_WHITE | BL_SOL)) {
char_u *ptr;
- for (ptr = get_cursor_line_ptr(); vim_iswhite(*ptr)
+ for (ptr = get_cursor_line_ptr(); ascii_iswhite(*ptr)
&& !((flags & BL_FIX) && ptr[1] == NUL); ++ptr)
++curwin->w_cursor.col;
}
@@ -7369,7 +7369,7 @@ static int ins_bs(int c, int mode, int *inserted_space_p)
/* delete characters until we are at or before want_vcol */
while (vcol > want_vcol
- && (cc = *(get_cursor_pos_ptr() - 1), vim_iswhite(cc)))
+ && (cc = *(get_cursor_pos_ptr() - 1), ascii_iswhite(cc)))
ins_bs_one(&vcol);
/* insert extra spaces until we are at want_vcol */
@@ -7882,7 +7882,7 @@ static int ins_tab(void)
/* Find first white before the cursor */
fpos = curwin->w_cursor;
- while (fpos.col > 0 && vim_iswhite(ptr[-1])) {
+ while (fpos.col > 0 && ascii_iswhite(ptr[-1])) {
--fpos.col;
--ptr;
}
@@ -7901,7 +7901,7 @@ static int ins_tab(void)
/* Use as many TABs as possible. Beware of 'breakindent', 'showbreak'
and 'linebreak' adding extra virtual columns. */
- while (vim_iswhite(*ptr)) {
+ while (ascii_iswhite(*ptr)) {
i = lbr_chartabsize(NULL, (char_u *)"\t", vcol);
if (vcol + i > want_vcol)
break;
@@ -8201,7 +8201,7 @@ static void ins_try_si(int c)
ptr = ml_get(pos->lnum);
i = pos->col;
if (i > 0) /* skip blanks before '{' */
- while (--i > 0 && vim_iswhite(ptr[i]))
+ while (--i > 0 && ascii_iswhite(ptr[i]))
;
curwin->w_cursor.lnum = pos->lnum;
curwin->w_cursor.col = i;
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 24502116f3..37a3514206 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -1636,7 +1636,7 @@ static char_u *list_arg_vars(exarg_T *eap, char_u *arg, int *first)
while (!ends_excmd(*arg) && !got_int) {
if (error || eap->skip) {
arg = find_name_end(arg, NULL, NULL, FNE_INCL_BR | FNE_CHECK_START);
- if (!vim_iswhite(*arg) && !ends_excmd(*arg)) {
+ if (!ascii_iswhite(*arg) && !ends_excmd(*arg)) {
emsg_severe = TRUE;
EMSG(_(e_trailing));
break;
@@ -1943,7 +1943,7 @@ get_lval (
p = find_name_end(name, &expr_start, &expr_end, fne_flags);
if (expr_start != NULL) {
/* Don't expand the name when we already know there is an error. */
- if (unlet && !vim_iswhite(*p) && !ends_excmd(*p)
+ if (unlet && !ascii_iswhite(*p) && !ends_excmd(*p)
&& *p != '[' && *p != '.') {
EMSG(_(e_trailing));
return NULL;
@@ -2476,7 +2476,7 @@ void *eval_for_line(char_u *arg, int *errp, char_u **nextcmdp, int skip)
return fi;
expr = skipwhite(expr);
- if (expr[0] != 'i' || expr[1] != 'n' || !vim_iswhite(expr[2])) {
+ if (expr[0] != 'i' || expr[1] != 'n' || !ascii_iswhite(expr[2])) {
EMSG(_("E690: Missing \"in\" after :for"));
return fi;
}
@@ -2556,7 +2556,7 @@ void set_context_for_expression(expand_T *xp, char_u *arg, cmdidx_T cmdidx)
for (p = arg + STRLEN(arg); p >= arg; ) {
xp->xp_pattern = p;
mb_ptr_back(arg, p);
- if (vim_iswhite(*p))
+ if (ascii_iswhite(*p))
break;
}
return;
@@ -2778,7 +2778,7 @@ static void ex_unletlock(exarg_T *eap, char_u *argstart, int deep)
FNE_CHECK_START);
if (lv.ll_name == NULL)
error = TRUE; /* error but continue parsing */
- if (name_end == NULL || (!vim_iswhite(*name_end)
+ if (name_end == NULL || (!ascii_iswhite(*name_end)
&& !ends_excmd(*name_end))) {
if (name_end != NULL) {
emsg_severe = TRUE;
@@ -16502,7 +16502,7 @@ handle_subscript (
&& (**arg == '['
|| (**arg == '.' && rettv->v_type == VAR_DICT)
|| (**arg == '(' && (!evaluate || rettv->v_type == VAR_FUNC)))
- && !vim_iswhite(*(*arg - 1))) {
+ && !ascii_iswhite(*(*arg - 1))) {
if (**arg == '(') {
/* need to copy the funcref so that we can clear rettv */
if (evaluate) {
@@ -17929,7 +17929,7 @@ void ex_function(exarg_T *eap)
}
} else {
/* skip ':' and blanks*/
- for (p = theline; vim_iswhite(*p) || *p == ':'; ++p)
+ for (p = theline; ascii_iswhite(*p) || *p == ':'; ++p)
;
/* Check for "endfunction". */
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index efb05d80fb..1dc1d9c420 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -266,7 +266,7 @@ static int linelen(int *has_tab)
/* find the character after the last non-blank character */
for (last = first + STRLEN(first);
- last > first && vim_iswhite(last[-1]); --last)
+ last > first && ascii_iswhite(last[-1]); --last)
;
save = *last;
*last = NUL;
@@ -374,7 +374,7 @@ void ex_sort(exarg_T *eap)
sort_abort = sort_ic = sort_rx = sort_nr = sort_oct = sort_hex = 0;
for (p = eap->arg; *p != NUL; ++p) {
- if (vim_iswhite(*p))
+ if (ascii_iswhite(*p))
;
else if (*p == 'i')
sort_ic = TRUE;
@@ -581,7 +581,7 @@ void ex_retab(exarg_T *eap)
vcol = 0;
did_undo = FALSE;
for (;; ) {
- if (vim_iswhite(ptr[col])) {
+ if (ascii_iswhite(ptr[col])) {
if (!got_tab && num_spaces == 0) {
/* First consecutive white-space */
start_vcol = vcol;
@@ -3422,7 +3422,7 @@ void do_sub(exarg_T *eap)
which_pat = RE_SUBST; /* use last substitute regexp */
/* new pattern and substitution */
- if (eap->cmd[0] == 's' && *cmd != NUL && !vim_iswhite(*cmd)
+ if (eap->cmd[0] == 's' && *cmd != NUL && !ascii_iswhite(*cmd)
&& vim_strchr((char_u *)"0123456789cegriIp|\"", *cmd) == NULL) {
/* don't accept alphanumeric for separator */
if (isalpha(*cmd)) {
@@ -4622,7 +4622,7 @@ void ex_help(exarg_T *eap)
/* remove trailing blanks */
p = arg + STRLEN(arg) - 1;
- while (p > arg && vim_iswhite(*p) && p[-1] != '\\')
+ while (p > arg && ascii_iswhite(*p) && p[-1] != '\\')
*p-- = NUL;
/* Check for a specified language */
@@ -5069,7 +5069,7 @@ void fix_help_buffer(void)
for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count; ++lnum) {
line = ml_get_buf(curbuf, lnum, FALSE);
len = (int)STRLEN(line);
- if (in_example && len > 0 && !vim_iswhite(line[0])) {
+ if (in_example && len > 0 && !ascii_iswhite(line[0])) {
/* End of example: non-white or '<' in first column. */
if (line[0] == '<') {
/* blank-out a '<' in the first column */
@@ -5281,7 +5281,7 @@ void ex_helptags(exarg_T *eap)
int add_help_tags = FALSE;
/* Check for ":helptags ++t {dir}". */
- if (STRNCMP(eap->arg, "++t", 3) == 0 && vim_iswhite(eap->arg[3])) {
+ if (STRNCMP(eap->arg, "++t", 3) == 0 && ascii_iswhite(eap->arg[3])) {
add_help_tags = TRUE;
eap->arg = skipwhite(eap->arg + 3);
}
@@ -5870,7 +5870,7 @@ void ex_sign(exarg_T *eap)
if (VIM_ISDIGIT(*arg))
{
id = getdigits_int(&arg);
- if (!vim_iswhite(*arg) && *arg != NUL)
+ if (!ascii_iswhite(*arg) && *arg != NUL)
{
id = -1;
arg = arg1;
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index dc04835774..fdcd467cb8 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -3091,7 +3091,7 @@ void ex_language(exarg_T *eap)
* Allow abbreviation, but require at least 3 characters to avoid
* confusion with a two letter language name "me" or "ct". */
p = skiptowhite(eap->arg);
- if ((*p == NUL || vim_iswhite(*p)) && p - eap->arg >= 3) {
+ if ((*p == NUL || ascii_iswhite(*p)) && p - eap->arg >= 3) {
if (STRNICMP(eap->arg, "messages", p - eap->arg) == 0) {
what = VIM_LC_MESSAGES;
name = skipwhite(p);
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 0bcc4a35ff..56def23258 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -1251,7 +1251,7 @@ static char_u * do_one_cmd(char_u **cmdlinep,
if (save_msg_silent == -1)
save_msg_silent = msg_silent;
++msg_silent;
- if (*ea.cmd == '!' && !vim_iswhite(ea.cmd[-1])) {
+ if (*ea.cmd == '!' && !ascii_iswhite(ea.cmd[-1])) {
/* ":silent!", but not "silent !cmd" */
ea.cmd = skipwhite(ea.cmd + 1);
++emsg_silent;
@@ -1722,7 +1722,7 @@ static char_u * do_one_cmd(char_u **cmdlinep,
*/
if ((ea.argt & COUNT) && VIM_ISDIGIT(*ea.arg)
&& (!(ea.argt & BUFNAME) || *(p = skipdigits(ea.arg)) == NUL
- || vim_iswhite(*p))) {
+ || ascii_iswhite(*p))) {
n = getdigits_long(&ea.arg);
ea.arg = skipwhite(ea.arg);
if (n <= 0 && !ni && (ea.argt & ZEROR) == 0) {
@@ -1875,7 +1875,7 @@ static char_u * do_one_cmd(char_u **cmdlinep,
p = skiptowhite_esc(ea.arg);
else {
p = ea.arg + STRLEN(ea.arg);
- while (p > ea.arg && vim_iswhite(p[-1]))
+ while (p > ea.arg && ascii_iswhite(p[-1]))
--p;
}
ea.line2 = buflist_findpat(ea.arg, p, (ea.argt & BUFUNL) != 0,
@@ -2577,7 +2577,7 @@ set_one_cmd_context (
else if (c == '|'
|| c == '\n'
|| c == '"'
- || vim_iswhite(c)) {
+ || ascii_iswhite(c)) {
len = 0; /* avoid getting stuck when space is in 'isfname' */
while (*p != NUL) {
if (has_mbyte)
@@ -3563,7 +3563,7 @@ int expand_filename(exarg_T *eap, char_u **cmdlinep, char_u **errormsgp)
/* skip escaped characters */
if (p[1] && (*p == '\\' || *p == Ctrl_V))
++p;
- else if (vim_iswhite(*p)) {
+ else if (ascii_iswhite(*p)) {
*errormsgp = (char_u *)_("E172: Only one file name allowed");
return FAIL;
}
@@ -4494,7 +4494,7 @@ static void ex_command(exarg_T *eap)
if (ASCII_ISALPHA(*p))
while (ASCII_ISALNUM(*p))
++p;
- if (!ends_excmd(*p) && !vim_iswhite(*p)) {
+ if (!ends_excmd(*p) && !ascii_iswhite(*p)) {
EMSG(_("E182: Invalid command name"));
return;
}
@@ -4597,13 +4597,13 @@ static char_u *uc_split_args(char_u *arg, size_t *lenp)
if (p[0] == '\\' && p[1] == '\\') {
len += 2;
p += 2;
- } else if (p[0] == '\\' && vim_iswhite(p[1])) {
+ } else if (p[0] == '\\' && ascii_iswhite(p[1])) {
len += 1;
p += 2;
} else if (*p == '\\' || *p == '"') {
len += 2;
p += 1;
- } else if (vim_iswhite(*p)) {
+ } else if (ascii_iswhite(*p)) {
p = skipwhite(p);
if (*p == NUL)
break;
@@ -4625,13 +4625,13 @@ static char_u *uc_split_args(char_u *arg, size_t *lenp)
*q++ = '\\';
*q++ = '\\';
p += 2;
- } else if (p[0] == '\\' && vim_iswhite(p[1])) {
+ } else if (p[0] == '\\' && ascii_iswhite(p[1])) {
*q++ = p[1];
p += 2;
} else if (*p == '\\' || *p == '"') {
*q++ = '\\';
*q++ = *p++;
- } else if (vim_iswhite(*p)) {
+ } else if (ascii_iswhite(*p)) {
p = skipwhite(p);
if (*p == NUL)
break;
@@ -8802,7 +8802,7 @@ static void ex_match(exarg_T *eap)
if (ends_excmd(*eap->arg))
end = eap->arg;
else if ((STRNICMP(eap->arg, "none", 4) == 0
- && (vim_iswhite(eap->arg[4]) || ends_excmd(eap->arg[4]))))
+ && (ascii_iswhite(eap->arg[4]) || ends_excmd(eap->arg[4]))))
end = eap->arg + 4;
else {
p = skiptowhite(eap->arg);
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 4a0a9da768..bb9db7e6cd 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -5524,7 +5524,7 @@ static event_T event_name2nr(char_u *start, char_u **end)
int len;
/* the event name ends with end of line, a blank or a comma */
- for (p = start; *p && !vim_iswhite(*p) && *p != ','; ++p)
+ for (p = start; *p && !ascii_iswhite(*p) && *p != ','; ++p)
;
for (i = 0; event_names[i].name != NULL; ++i) {
len = (int)STRLEN(event_names[i].name);
@@ -5565,13 +5565,13 @@ find_end_event (
char_u *p;
if (*arg == '*') {
- if (arg[1] && !vim_iswhite(arg[1])) {
+ if (arg[1] && !ascii_iswhite(arg[1])) {
EMSG2(_("E215: Illegal character after *: %s"), arg);
return NULL;
}
pat = arg + 1;
} else {
- for (pat = arg; *pat && !vim_iswhite(*pat); pat = p) {
+ for (pat = arg; *pat && !ascii_iswhite(*pat); pat = p) {
if ((int)event_name2nr(pat, &p) >= (int)NUM_EVENTS) {
if (have_group)
EMSG2(_("E216: No such event: %s"), pat);
@@ -5711,7 +5711,7 @@ void do_autocmd(char_u *arg, int forceit)
*/
pat = skipwhite(pat);
cmd = pat;
- while (*cmd && (!vim_iswhite(*cmd) || cmd[-1] == '\\'))
+ while (*cmd && (!ascii_iswhite(*cmd) || cmd[-1] == '\\'))
cmd++;
if (*cmd)
*cmd++ = NUL;
@@ -5736,7 +5736,7 @@ void do_autocmd(char_u *arg, int forceit)
* Check for "nested" flag.
*/
cmd = skipwhite(cmd);
- if (*cmd != NUL && STRNCMP(cmd, "nested", 6) == 0 && vim_iswhite(cmd[6])) {
+ if (*cmd != NUL && STRNCMP(cmd, "nested", 6) == 0 && ascii_iswhite(cmd[6])) {
nested = TRUE;
cmd = skipwhite(cmd + 6);
}
@@ -5772,7 +5772,7 @@ void do_autocmd(char_u *arg, int forceit)
nested, cmd, forceit, group) == FAIL)
break;
} else {
- while (*arg && !vim_iswhite(*arg)) {
+ while (*arg && !ascii_iswhite(*arg)) {
event_T event = event_name2nr(arg, &arg);
assert(event < NUM_EVENTS);
if (do_autocmd_event(event, pat, nested, cmd, forceit, group) == FAIL) {
@@ -6056,7 +6056,7 @@ do_doautocmd (
/*
* Loop over the events.
*/
- while (*arg && !vim_iswhite(*arg))
+ while (*arg && !ascii_iswhite(*arg))
if (apply_autocmds_group(event_name2nr(arg, &arg),
fname, NULL, TRUE, group, curbuf, NULL))
nothing_done = FALSE;
@@ -6983,13 +6983,13 @@ set_context_in_autocmd (
group = au_get_grouparg(&arg);
/* If there only is a group name that's what we expand. */
- if (*arg == NUL && group != AUGROUP_ALL && !vim_iswhite(arg[-1])) {
+ if (*arg == NUL && group != AUGROUP_ALL && !ascii_iswhite(arg[-1])) {
arg = p;
group = AUGROUP_ALL;
}
/* skip over event name */
- for (p = arg; *p != NUL && !vim_iswhite(*p); ++p)
+ for (p = arg; *p != NUL && !ascii_iswhite(*p); ++p)
if (*p == ',')
arg = p + 1;
if (*p == NUL) {
@@ -7002,7 +7002,7 @@ set_context_in_autocmd (
/* skip over pattern */
arg = skipwhite(p);
- while (*arg && (!vim_iswhite(*arg) || arg[-1] == '\\'))
+ while (*arg && (!ascii_iswhite(*arg) || arg[-1] == '\\'))
arg++;
if (*arg)
return arg; /* expand (next) command */
diff --git a/src/nvim/fold.c b/src/nvim/fold.c
index 8e6c2a598e..56f1aade44 100644
--- a/src/nvim/fold.c
+++ b/src/nvim/fold.c
@@ -1787,7 +1787,7 @@ void foldtext_cleanup(char_u *str)
/* Ignore leading and trailing white space in 'commentstring'. */
char_u *cms_start = skipwhite(curbuf->b_p_cms);
size_t cms_slen = STRLEN(cms_start);
- while (cms_slen > 0 && vim_iswhite(cms_start[cms_slen - 1]))
+ while (cms_slen > 0 && ascii_iswhite(cms_start[cms_slen - 1]))
--cms_slen;
/* locate "%s" in 'commentstring', use the part before and after it. */
@@ -1798,7 +1798,7 @@ void foldtext_cleanup(char_u *str)
cms_slen = (size_t)(cms_end - cms_start);
/* exclude white space before "%s" */
- while (cms_slen > 0 && vim_iswhite(cms_start[cms_slen - 1]))
+ while (cms_slen > 0 && ascii_iswhite(cms_start[cms_slen - 1]))
--cms_slen;
/* skip "%s" and white space after it */
@@ -1820,7 +1820,7 @@ void foldtext_cleanup(char_u *str)
/* May remove 'commentstring' start. Useful when it's a double
* quote and we already removed a double quote. */
- for (p = s; p > str && vim_iswhite(p[-1]); --p)
+ for (p = s; p > str && ascii_iswhite(p[-1]); --p)
;
if (p >= str + cms_slen
&& STRNCMP(p - cms_slen, cms_start, cms_slen) == 0) {
@@ -1838,7 +1838,7 @@ void foldtext_cleanup(char_u *str)
}
}
if (len != 0) {
- while (vim_iswhite(s[len]))
+ while (ascii_iswhite(s[len]))
++len;
STRMOVE(s, s + len);
} else {
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index f45ee609bd..fbf3c31e1e 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -2129,7 +2129,7 @@ static int vgetorpeek(int advance)
col = vcol = curwin->w_wcol = 0;
ptr = get_cursor_line_ptr();
while (col < curwin->w_cursor.col) {
- if (!vim_iswhite(ptr[col]))
+ if (!ascii_iswhite(ptr[col]))
curwin->w_wcol = vcol;
vcol += lbr_chartabsize(ptr, ptr + col,
(colnr_T)vcol);
@@ -2672,7 +2672,7 @@ do_map (
*/
p = keys;
do_backslash = (vim_strchr(p_cpo, CPO_BSLASH) == NULL);
- while (*p && (maptype == 1 || !vim_iswhite(*p))) {
+ while (*p && (maptype == 1 || !ascii_iswhite(*p))) {
if ((p[0] == Ctrl_V || (do_backslash && p[0] == '\\')) &&
p[1] != NUL)
++p; /* skip CTRL-V or backslash */
@@ -2761,7 +2761,7 @@ do_map (
}
/* An abbreviation cannot contain white space. */
for (n = 0; n < len; ++n)
- if (vim_iswhite(keys[n])) {
+ if (ascii_iswhite(keys[n])) {
retval = 1;
goto theend;
}
@@ -4074,7 +4074,7 @@ int put_escstr(FILE *fd, char_u *strstart, int what)
* interpreted as the start of a special key name.
* A space in the lhs of a :map needs a CTRL-V.
*/
- if (what == 2 && (vim_iswhite(c) || c == '"' || c == '\\')) {
+ if (what == 2 && (ascii_iswhite(c) || c == '"' || c == '\\')) {
if (putc('\\', fd) < 0)
return FAIL;
} else if (c < ' ' || c > '~' || c == '|'
diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c
index 48d8522865..e25ab89027 100644
--- a/src/nvim/if_cscope.c
+++ b/src/nvim/if_cscope.c
@@ -687,7 +687,7 @@ static char *cs_create_cmd(char *csoption, char *pattern)
* they may want to use the leading white space. */
pat = pattern;
if (search != 4 && search != 6)
- while (vim_iswhite(*pat))
+ while (ascii_iswhite(*pat))
++pat;
cmd = xmalloc(strlen(pat) + 2);
diff --git a/src/nvim/indent.c b/src/nvim/indent.c
index 183456d3f7..c1733346fc 100644
--- a/src/nvim/indent.c
+++ b/src/nvim/indent.c
@@ -118,7 +118,7 @@ int set_indent(int size, int flags)
ind_done = 0;
// Count as many characters as we can use.
- while (todo > 0 && vim_iswhite(*p)) {
+ while (todo > 0 && ascii_iswhite(*p)) {
if (*p == TAB) {
tab_pad = (int)curbuf->b_p_ts - (ind_done % (int)curbuf->b_p_ts);
@@ -183,7 +183,7 @@ int set_indent(int size, int flags)
}
// Return if the indent is OK already.
- if (!doit && !vim_iswhite(*p) && !(flags & SIN_INSERT)) {
+ if (!doit && !ascii_iswhite(*p) && !(flags & SIN_INSERT)) {
return false;
}
@@ -216,7 +216,7 @@ int set_indent(int size, int flags)
// Skip over any additional white space (useful when newindent is less
// than old).
- while (vim_iswhite(*p)) {
+ while (ascii_iswhite(*p)) {
p++;
}
} else {
@@ -235,7 +235,7 @@ int set_indent(int size, int flags)
p = oldline;
ind_done = 0;
- while (todo > 0 && vim_iswhite(*p)) {
+ while (todo > 0 && ascii_iswhite(*p)) {
if (*p == TAB) {
tab_pad = (int)curbuf->b_p_ts - (ind_done % (int)curbuf->b_p_ts);
@@ -328,7 +328,7 @@ int copy_indent(int size, char_u *src)
s = src;
// Count/copy the usable portion of the source line.
- while (todo > 0 && vim_iswhite(*s)) {
+ while (todo > 0 && ascii_iswhite(*s)) {
if (*s == TAB) {
tab_pad = (int)curbuf->b_p_ts
- (ind_done % (int)curbuf->b_p_ts);
@@ -502,7 +502,7 @@ int inindent(int extra)
char_u *ptr;
colnr_T col;
- for (col = 0, ptr = get_cursor_line_ptr(); vim_iswhite(*ptr); ++col) {
+ for (col = 0, ptr = get_cursor_line_ptr(); ascii_iswhite(*ptr); ++col) {
ptr++;
}
@@ -688,7 +688,7 @@ int get_lisp_indent(void)
amount++;
firsttry = amount;
- while (vim_iswhite(*that)) {
+ while (ascii_iswhite(*that)) {
amount += lbr_chartabsize(line, that, (colnr_T)amount);
that++;
}
@@ -706,7 +706,7 @@ int get_lisp_indent(void)
if (vi_lisp || ((*that != '"') && (*that != '\'')
&& (*that != '#') && ((*that < '0') || (*that > '9')))) {
- while (*that && (!vim_iswhite(*that) || quotecount || parencount)
+ while (*that && (!ascii_iswhite(*that) || quotecount || parencount)
&& (!((*that == '(' || *that == '[')
&& !quotecount && !parencount && vi_lisp))) {
if (*that == '"') {
@@ -726,7 +726,7 @@ int get_lisp_indent(void)
}
}</