Skip to content

Commit

Permalink
patch 8.0.1091: test for <cexpr> fails without +balloon_eval feature
Browse files Browse the repository at this point in the history
Problem:    Test for <cexpr> fails without +balloon_eval feature.
Solution:   Remove #ifdefs.
  • Loading branch information
brammool committed Sep 10, 2017
1 parent 65f0847 commit 95c83c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/normal.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3353,9 +3353,6 @@ reset_VIsual(void)
} }
} }


#if defined(FEAT_BEVAL)
static int find_is_eval_item(char_u *ptr, int *colp, int *nbp, int dir);

/* /*
* Check for a balloon-eval special item to include when searching for an * Check for a balloon-eval special item to include when searching for an
* identifier. When "dir" is BACKWARD "ptr[-1]" must be valid! * identifier. When "dir" is BACKWARD "ptr[-1]" must be valid!
Expand Down Expand Up @@ -3394,7 +3391,6 @@ find_is_eval_item(
} }
return FALSE; return FALSE;
} }
#endif


/* /*
* Find the identifier under or to the right of the cursor. * Find the identifier under or to the right of the cursor.
Expand Down Expand Up @@ -3444,9 +3440,7 @@ find_ident_at_pos(
int prev_class; int prev_class;
int prevcol; int prevcol;
#endif #endif
#if defined(FEAT_BEVAL)
int bn = 0; /* bracket nesting */ int bn = 0; /* bracket nesting */
#endif


/* /*
* if i == 0: try to find an identifier * if i == 0: try to find an identifier
Expand All @@ -3464,11 +3458,9 @@ find_ident_at_pos(
{ {
while (ptr[col] != NUL) while (ptr[col] != NUL)
{ {
# if defined(FEAT_BEVAL)
/* Stop at a ']' to evaluate "a[x]". */ /* Stop at a ']' to evaluate "a[x]". */
if ((find_type & FIND_EVAL) && ptr[col] == ']') if ((find_type & FIND_EVAL) && ptr[col] == ']')
break; break;
# endif
this_class = mb_get_class(ptr + col); this_class = mb_get_class(ptr + col);
if (this_class != 0 && (i == 1 || this_class != 1)) if (this_class != 0 && (i == 1 || this_class != 1))
break; break;
Expand All @@ -3479,16 +3471,12 @@ find_ident_at_pos(
#endif #endif
while (ptr[col] != NUL while (ptr[col] != NUL
&& (i == 0 ? !vim_iswordc(ptr[col]) : VIM_ISWHITE(ptr[col])) && (i == 0 ? !vim_iswordc(ptr[col]) : VIM_ISWHITE(ptr[col]))
# if defined(FEAT_BEVAL)
&& (!(find_type & FIND_EVAL) || ptr[col] != ']') && (!(find_type & FIND_EVAL) || ptr[col] != ']')
# endif
) )
++col; ++col;


#if defined(FEAT_BEVAL)
/* When starting on a ']' count it, so that we include the '['. */ /* When starting on a ']' count it, so that we include the '['. */
bn = ptr[col] == ']'; bn = ptr[col] == ']';
#endif


/* /*
* 2. Back up to start of identifier/string. * 2. Back up to start of identifier/string.
Expand All @@ -3497,11 +3485,9 @@ find_ident_at_pos(
if (has_mbyte) if (has_mbyte)
{ {
/* Remember class of character under cursor. */ /* Remember class of character under cursor. */
# if defined(FEAT_BEVAL)
if ((find_type & FIND_EVAL) && ptr[col] == ']') if ((find_type & FIND_EVAL) && ptr[col] == ']')
this_class = mb_get_class((char_u *)"a"); this_class = mb_get_class((char_u *)"a");
else else
# endif
this_class = mb_get_class(ptr + col); this_class = mb_get_class(ptr + col);
while (col > 0 && this_class != 0) while (col > 0 && this_class != 0)
{ {
Expand All @@ -3511,12 +3497,10 @@ find_ident_at_pos(
&& (i == 0 && (i == 0
|| prev_class == 0 || prev_class == 0
|| (find_type & FIND_IDENT)) || (find_type & FIND_IDENT))
# if defined(FEAT_BEVAL)
&& (!(find_type & FIND_EVAL) && (!(find_type & FIND_EVAL)
|| prevcol == 0 || prevcol == 0
|| !find_is_eval_item(ptr + prevcol, &prevcol, || !find_is_eval_item(ptr + prevcol, &prevcol,
&bn, BACKWARD)) &bn, BACKWARD))
# endif
) )
break; break;
col = prevcol; col = prevcol;
Expand All @@ -3538,12 +3522,10 @@ find_ident_at_pos(
: (!VIM_ISWHITE(ptr[col - 1]) : (!VIM_ISWHITE(ptr[col - 1])
&& (!(find_type & FIND_IDENT) && (!(find_type & FIND_IDENT)
|| !vim_iswordc(ptr[col - 1])))) || !vim_iswordc(ptr[col - 1]))))
#if defined(FEAT_BEVAL)
|| ((find_type & FIND_EVAL) || ((find_type & FIND_EVAL)
&& col > 1 && col > 1
&& find_is_eval_item(ptr + col - 1, &col, && find_is_eval_item(ptr + col - 1, &col,
&bn, BACKWARD)) &bn, BACKWARD))
#endif
)) ))
--col; --col;


Expand Down Expand Up @@ -3575,10 +3557,8 @@ find_ident_at_pos(
/* /*
* 3. Find the end if the identifier/string. * 3. Find the end if the identifier/string.
*/ */
#if defined(FEAT_BEVAL)
bn = 0; bn = 0;
startcol -= col; startcol -= col;
#endif
col = 0; col = 0;
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
if (has_mbyte) if (has_mbyte)
Expand All @@ -3588,23 +3568,19 @@ find_ident_at_pos(
while (ptr[col] != NUL while (ptr[col] != NUL
&& ((i == 0 ? mb_get_class(ptr + col) == this_class && ((i == 0 ? mb_get_class(ptr + col) == this_class
: mb_get_class(ptr + col) != 0) : mb_get_class(ptr + col) != 0)
# if defined(FEAT_BEVAL)
|| ((find_type & FIND_EVAL) || ((find_type & FIND_EVAL)
&& col <= (int)startcol && col <= (int)startcol
&& find_is_eval_item(ptr + col, &col, &bn, FORWARD)) && find_is_eval_item(ptr + col, &col, &bn, FORWARD))
# endif
)) ))
col += (*mb_ptr2len)(ptr + col); col += (*mb_ptr2len)(ptr + col);
} }
else else
#endif #endif
while ((i == 0 ? vim_iswordc(ptr[col]) while ((i == 0 ? vim_iswordc(ptr[col])
: (ptr[col] != NUL && !VIM_ISWHITE(ptr[col]))) : (ptr[col] != NUL && !VIM_ISWHITE(ptr[col])))
# if defined(FEAT_BEVAL)
|| ((find_type & FIND_EVAL) || ((find_type & FIND_EVAL)
&& col <= (int)startcol && col <= (int)startcol
&& find_is_eval_item(ptr + col, &col, &bn, FORWARD)) && find_is_eval_item(ptr + col, &col, &bn, FORWARD))
# endif
) )
{ {
++col; ++col;
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -769,6 +769,8 @@ static char *(features[]) =


static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1091,
/**/ /**/
1090, 1090,
/**/ /**/
Expand Down

0 comments on commit 95c83c6

Please sign in to comment.