@@ -6103,7 +6103,7 @@ cin_isterminated(
61036103 * When a line ends in a comma we continue looking in the next line.
61046104 * "sp" points to a string with the line. When looking at other lines it must
61056105 * be restored to the line. When it's NULL fetch lines here.
6106- * "lnum " is where we start looking.
6106+ * "first_lnum " is where we start looking.
61076107 * "min_lnum" is the line before which we will not be looking.
61086108 */
61096109 static int
@@ -6114,6 +6114,7 @@ cin_isfuncdecl(
61146114{
61156115 char_u * s ;
61166116 linenr_T lnum = first_lnum ;
6117+ linenr_T save_lnum = curwin -> w_cursor .lnum ;
61176118 int retval = FALSE;
61186119 pos_T * trypos ;
61196120 int just_started = TRUE;
@@ -6123,15 +6124,20 @@ cin_isfuncdecl(
61236124 else
61246125 s = * sp ;
61256126
6127+ curwin -> w_cursor .lnum = lnum ;
61266128 if (find_last_paren (s , '(' , ')' )
61276129 && (trypos = find_match_paren (curbuf -> b_ind_maxparen )) != NULL )
61286130 {
61296131 lnum = trypos -> lnum ;
61306132 if (lnum < min_lnum )
6133+ {
6134+ curwin -> w_cursor .lnum = save_lnum ;
61316135 return FALSE;
6136+ }
61326137
61336138 s = ml_get (lnum );
61346139 }
6140+ curwin -> w_cursor .lnum = save_lnum ;
61356141
61366142 /* Ignore line starting with #. */
61376143 if (cin_ispreproc (s ))
@@ -6687,7 +6693,7 @@ find_start_brace(void) /* XXX */
66876693 static pos_T *
66886694find_match_paren (int ind_maxparen ) /* XXX */
66896695{
6690- return find_match_char ('(' , ind_maxparen );
6696+ return find_match_char ('(' , ind_maxparen );
66916697}
66926698
66936699 static pos_T *
0 commit comments