@@ -6097,7 +6097,7 @@ cin_isterminated(
60976097 * When a line ends in a comma we continue looking in the next line.
60986098 * "sp" points to a string with the line. When looking at other lines it must
60996099 * 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.
61016101 * "min_lnum" is the line before which we will not be looking.
61026102 */
61036103 static int
@@ -6108,6 +6108,7 @@ cin_isfuncdecl(
61086108{
61096109 char_u * s ;
61106110 linenr_T lnum = first_lnum ;
6111+ linenr_T save_lnum = curwin -> w_cursor .lnum ;
61116112 int retval = FALSE;
61126113 pos_T * trypos ;
61136114 int just_started = TRUE;
@@ -6117,15 +6118,20 @@ cin_isfuncdecl(
61176118 else
61186119 s = * sp ;
61196120
6121+ curwin -> w_cursor .lnum = lnum ;
61206122 if (find_last_paren (s , '(' , ')' )
61216123 && (trypos = find_match_paren (curbuf -> b_ind_maxparen )) != NULL )
61226124 {
61236125 lnum = trypos -> lnum ;
61246126 if (lnum < min_lnum )
6127+ {
6128+ curwin -> w_cursor .lnum = save_lnum ;
61256129 return FALSE;
6130+ }
61266131
61276132 s = ml_get (lnum );
61286133 }
6134+ curwin -> w_cursor .lnum = save_lnum ;
61296135
61306136 /* Ignore line starting with #. */
61316137 if (cin_ispreproc (s ))
@@ -6681,7 +6687,7 @@ find_start_brace(void) /* XXX */
66816687 static pos_T *
66826688find_match_paren (int ind_maxparen ) /* XXX */
66836689{
6684- return find_match_char ('(' , ind_maxparen );
6690+ return find_match_char ('(' , ind_maxparen );
66856691}
66866692
66876693 static pos_T *
0 commit comments