diff options
Diffstat (limited to 'src/nvim/syntax.c')
| -rw-r--r-- | src/nvim/syntax.c | 29 | 
1 files changed, 15 insertions, 14 deletions
| diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 8c32e5f06a..2df0e72f8f 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -1973,7 +1973,7 @@ syn_current_attr (        if (!found_match) {          line = syn_getcurline();          if (((current_next_flags & HL_SKIPWHITE) -             && vim_iswhite(line[current_col])) +             && ascii_iswhite(line[current_col]))              || ((current_next_flags & HL_SKIPEMPTY)                  && *line == NUL))            break; @@ -3941,7 +3941,7 @@ get_syn_options (        for (i = 0, len = 0; p[i] != NUL; i += 2, ++len)          if (arg[len] != p[i] && arg[len] != p[i + 1])            break; -      if (p[i] == NUL && (vim_iswhite(arg[len]) +      if (p[i] == NUL && (ascii_iswhite(arg[len])                            || (flagtab[fidx].argtype > 0                                ? arg[len] == '='                                : ends_excmd(arg[len])))) { @@ -4161,7 +4161,7 @@ static void syn_cmd_keyword(exarg_T *eap, int syncing)        if (rest == NULL || ends_excmd(*rest))          break;        /* Copy the keyword, removing backslashes, and add a NUL. */ -      while (*rest != NUL && !vim_iswhite(*rest)) { +      while (*rest != NUL && !ascii_iswhite(*rest)) {          if (*rest == '\\' && rest[1] != NUL)            ++rest;          *p++ = *rest++; @@ -4386,7 +4386,7 @@ syn_cmd_region (      /* must be a pattern or matchgroup then */      key_end = rest; -    while (*key_end && !vim_iswhite(*key_end) && *key_end != '=') +    while (*key_end && !ascii_iswhite(*key_end) && *key_end != '=')        ++key_end;      xfree(key);      key = vim_strnsave_up(rest, (int)(key_end - rest)); @@ -4791,15 +4791,15 @@ static void syn_cmd_cluster(exarg_T *eap, int syncing)      for (;; ) {        if (STRNICMP(rest, "add", 3) == 0 -          && (vim_iswhite(rest[3]) || rest[3] == '=')) { +          && (ascii_iswhite(rest[3]) || rest[3] == '=')) {          opt_len = 3;          list_op = CLUSTER_ADD;        } else if (STRNICMP(rest, "remove", 6) == 0 -                 && (vim_iswhite(rest[6]) || rest[6] == '=')) { +                 && (ascii_iswhite(rest[6]) || rest[6] == '=')) {          opt_len = 6;          list_op = CLUSTER_SUBTRACT;        } else if (STRNICMP(rest, "contains", 8) == 0 -                 && (vim_iswhite(rest[8]) || rest[8] == '=')) { +                 && (ascii_iswhite(rest[8]) || rest[8] == '=')) {          opt_len = 8;          list_op = CLUSTER_REPLACE;        } else @@ -4916,7 +4916,7 @@ static char_u *get_syn_pattern(char_u *arg, synpat_T *ci)      }    } while (idx >= 0); -  if (!ends_excmd(*end) && !vim_iswhite(*end)) { +  if (!ends_excmd(*end) && !ascii_iswhite(*end)) {      EMSG2(_("E402: Garbage after pattern: %s"), arg);      return NULL;    } @@ -4968,7 +4968,7 @@ static void syn_cmd_sync(exarg_T *eap, int syncing)          arg_end = key + 11;        else          arg_end = key + 9; -      if (arg_end[-1] != '=' || !VIM_ISDIGIT(*arg_end)) { +      if (arg_end[-1] != '=' || !ascii_isdigit(*arg_end)) {          illegal = TRUE;          break;        } @@ -5098,7 +5098,7 @@ get_id_list (       */      count = 0;      do { -      for (end = p; *end && !vim_iswhite(*end) && *end != ','; ++end) +      for (end = p; *end && !ascii_iswhite(*end) && *end != ','; ++end)          ;        name = xmalloc((int)(end - p + 3));             /* leave room for "^$" */        STRLCPY(name + 1, p, end - p + 1); @@ -6143,7 +6143,7 @@ do_highlight (         * Isolate the key ("term", "ctermfg", "ctermbg", "font", "guifg" or         * "guibg").         */ -      while (*linep && !vim_iswhite(*linep) && *linep != '=') +      while (*linep && !ascii_iswhite(*linep) && *linep != '=')          ++linep;        xfree(key);        key = vim_strnsave_up(key_start, (int)(linep - key_start)); @@ -6251,7 +6251,7 @@ do_highlight (              HL_TABLE()[idx].sg_cterm_bold = FALSE;            } -          if (VIM_ISDIGIT(*arg)) +          if (ascii_isdigit(*arg))              color = atoi((char *)arg);            else if (STRICMP(arg, "fg") == 0) {              if (cterm_normal_fg_color) @@ -7138,9 +7138,10 @@ int highlight_changed(void)         */        attr = 0;        bool colon = false; -      for (; *p && *p != ','; ++p) {                /* parse upto comma */ -        if (vim_iswhite(*p))                        /* ignore white space */ +      for (; *p && *p != ','; ++p) {  // parse upto comma +        if (ascii_iswhite(*p)) {  // ignore white space            continue; +        }          if (colon)          /* Combination with ':' is not allowed. */            return FAIL; | 
