diff options
| author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2015-04-25 13:34:30 -0300 | 
|---|---|---|
| committer | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2015-04-25 13:37:44 -0300 | 
| commit | 0bce4dc54427d05ab320a88f6269a9c1b05ea899 (patch) | |
| tree | 4a3aff2749eb0b70b7947ecfc7cd56d56ad4e29d /src/nvim/ex_cmds.c | |
| parent | d350d12a00518aa0d9e3a1d49c6815c3398d882f (diff) | |
| parent | c96b933acc4d9ec7382d451055e44c85959772b9 (diff) | |
| download | rneovim-0bce4dc54427d05ab320a88f6269a9c1b05ea899.tar.gz rneovim-0bce4dc54427d05ab320a88f6269a9c1b05ea899.tar.bz2 rneovim-0bce4dc54427d05ab320a88f6269a9c1b05ea899.zip | |
Merge #2486: Replacements for vim_iswhite, VIM_ISDIGIT, vim_isdigit, vim_isxdigit, and vim_isspace
Reviewed-by: Michael Reed <m.reed@mykolab.com>
Diffstat (limited to 'src/nvim/ex_cmds.c')
| -rw-r--r-- | src/nvim/ex_cmds.c | 24 | 
1 files changed, 12 insertions, 12 deletions
| diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index efb05d80fb..78200e4689 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; @@ -1858,7 +1858,7 @@ viminfo_readstring (    char_u      *retval;    char_u      *s, *d; -  if (virp->vir_line[off] == Ctrl_V && vim_isdigit(virp->vir_line[off + 1])) { +  if (virp->vir_line[off] == Ctrl_V && ascii_isdigit(virp->vir_line[off + 1])) {      ssize_t len = atol((char *)virp->vir_line + off + 1);      retval = xmalloc(len);      // TODO(philix): change type of vim_fgets() size argument to size_t @@ -3244,7 +3244,7 @@ void ex_z(exarg_T *eap)      ++x;    if (*x != 0) { -    if (!VIM_ISDIGIT(*x)) { +    if (!ascii_isdigit(*x)) {        EMSG(_("E144: non-numeric argument to :z"));        return;      } @@ -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)) { @@ -3591,7 +3591,7 @@ void do_sub(exarg_T *eap)     * check for a trailing count     */    cmd = skipwhite(cmd); -  if (VIM_ISDIGIT(*cmd)) { +  if (ascii_isdigit(*cmd)) {      i = getdigits_long(&cmd);      if (i <= 0 && !eap->skip && do_error) {        EMSG(_(e_zerocount)); @@ -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);    } @@ -5867,10 +5867,10 @@ void ex_sign(exarg_T *eap)  	/* first arg could be placed sign id */  	arg1 = arg; -	if (VIM_ISDIGIT(*arg)) +	if (ascii_isdigit(*arg))  	{  	    id = getdigits_int(&arg); -	    if (!vim_iswhite(*arg) && *arg != NUL) +	    if (!ascii_iswhite(*arg) && *arg != NUL)  	    {  		id = -1;  		arg = arg1; | 
