Merge pull request #6345 from brcolow/vim-7.4.2360

vim-patch:7.4.2360
This commit is contained in:
James McCoy 2017-06-08 16:38:21 +00:00 committed by GitHub
commit 1a093c08d0
2 changed files with 23 additions and 18 deletions

View File

@ -822,21 +822,22 @@ cin_isterminated (
return found_start; return found_start;
} }
/* /// Recognizes the basic picture of a function declaration -- it needs to
* Recognize the basic picture of a function declaration -- it needs to /// have an open paren somewhere and a close paren at the end of the line and
* have an open paren somewhere and a close paren at the end of the line and /// no semicolons anywhere.
* no semicolons anywhere. /// When a line ends in a comma we continue looking in the next line.
* When a line ends in a comma we continue looking in the next line. ///
* "sp" points to a string with the line. When looking at other lines it must /// @param[in] sp Points to a string with the line. When looking at other
* be restored to the line. When it's NULL fetch lines here. /// lines it must be restored to the line. When it's NULL fetch
* "lnum" is where we start looking. /// lines here.
* "min_lnum" is the line before which we will not be looking. /// @param[in] first_lnum Where to start looking.
*/ /// @param[in] min_lnum The line before which we will not be looking.
static int cin_isfuncdecl(char_u **sp, linenr_T first_lnum, linenr_T min_lnum) static int cin_isfuncdecl(char_u **sp, linenr_T first_lnum, linenr_T min_lnum)
{ {
char_u *s; char_u *s;
linenr_T lnum = first_lnum; linenr_T lnum = first_lnum;
int retval = FALSE; linenr_T save_lnum = curwin->w_cursor.lnum;
int retval = false;
pos_T *trypos; pos_T *trypos;
int just_started = TRUE; int just_started = TRUE;
@ -845,18 +846,22 @@ static int cin_isfuncdecl(char_u **sp, linenr_T first_lnum, linenr_T min_lnum)
else else
s = *sp; s = *sp;
curwin->w_cursor.lnum = lnum;
if (find_last_paren(s, '(', ')') if (find_last_paren(s, '(', ')')
&& (trypos = find_match_paren(curbuf->b_ind_maxparen)) != NULL) { && (trypos = find_match_paren(curbuf->b_ind_maxparen)) != NULL) {
lnum = trypos->lnum; lnum = trypos->lnum;
if (lnum < min_lnum) if (lnum < min_lnum) {
return FALSE; curwin->w_cursor.lnum = save_lnum;
return false;
}
s = ml_get(lnum); s = ml_get(lnum);
} }
/* Ignore line starting with #. */ curwin->w_cursor.lnum = save_lnum;
if (cin_ispreproc(s)) // Ignore line starting with #.
return FALSE; if (cin_ispreproc(s)) {
return false;
}
while (*s && *s != '(' && *s != ';' && *s != '\'' && *s != '"') { while (*s && *s != '(' && *s != ';' && *s != '\'' && *s != '"') {
// ignore comments // ignore comments

View File

@ -84,7 +84,7 @@ static const int included_patches[] = {
// 2363 NA // 2363 NA
2362, 2362,
// 2361 NA // 2361 NA
// 2360, 2360,
2359, 2359,
// 2358 NA // 2358 NA
2357, 2357,