@@ -6097,7 +6097,7 @@ cin_isterminated(
6097
6097
* When a line ends in a comma we continue looking in the next line.
6098
6098
* "sp" points to a string with the line. When looking at other lines it must
6099
6099
* be restored to the line. When it's NULL fetch lines here.
6100
- * "lnum " is where we start looking.
6100
+ * "first_lnum " is where we start looking.
6101
6101
* "min_lnum" is the line before which we will not be looking.
6102
6102
*/
6103
6103
static int
@@ -6108,6 +6108,7 @@ cin_isfuncdecl(
6108
6108
{
6109
6109
char_u * s ;
6110
6110
linenr_T lnum = first_lnum ;
6111
+ linenr_T save_lnum = curwin -> w_cursor .lnum ;
6111
6112
int retval = FALSE;
6112
6113
pos_T * trypos ;
6113
6114
int just_started = TRUE;
@@ -6117,15 +6118,20 @@ cin_isfuncdecl(
6117
6118
else
6118
6119
s = * sp ;
6119
6120
6121
+ curwin -> w_cursor .lnum = lnum ;
6120
6122
if (find_last_paren (s , '(' , ')' )
6121
6123
&& (trypos = find_match_paren (curbuf -> b_ind_maxparen )) != NULL )
6122
6124
{
6123
6125
lnum = trypos -> lnum ;
6124
6126
if (lnum < min_lnum )
6127
+ {
6128
+ curwin -> w_cursor .lnum = save_lnum ;
6125
6129
return FALSE;
6130
+ }
6126
6131
6127
6132
s = ml_get (lnum );
6128
6133
}
6134
+ curwin -> w_cursor .lnum = save_lnum ;
6129
6135
6130
6136
/* Ignore line starting with #. */
6131
6137
if (cin_ispreproc (s ))
@@ -6681,7 +6687,7 @@ find_start_brace(void) /* XXX */
6681
6687
static pos_T *
6682
6688
find_match_paren (int ind_maxparen ) /* XXX */
6683
6689
{
6684
- return find_match_char ('(' , ind_maxparen );
6690
+ return find_match_char ('(' , ind_maxparen );
6685
6691
}
6686
6692
6687
6693
static pos_T *
0 commit comments