8b9a1c
To: vim_dev@googlegroups.com
8b9a1c
Subject: Patch 7.4.071
8b9a1c
Fcc: outbox
8b9a1c
From: Bram Moolenaar <Bram@moolenaar.net>
8b9a1c
Mime-Version: 1.0
8b9a1c
Content-Type: text/plain; charset=UTF-8
8b9a1c
Content-Transfer-Encoding: 8bit
8b9a1c
------------
8b9a1c
8b9a1c
Patch 7.4.071 (after 7.4.069)
8b9a1c
Problem:    Passing limits around too often.
8b9a1c
Solution:   Use limits from buffer.
8b9a1c
Files:      src/edit.c, src/misc1.c, src/proto/misc1.pro
8b9a1c
8b9a1c
8b9a1c
*** ../vim-7.4.070/src/edit.c	2013-11-05 07:12:59.000000000 +0100
8b9a1c
--- src/edit.c	2013-11-06 03:19:10.000000000 +0100
8b9a1c
***************
8b9a1c
*** 7857,7864 ****
8b9a1c
  	    if (try_match && keytyped == ':')
8b9a1c
  	    {
8b9a1c
  		p = ml_get_curline();
8b9a1c
! 		if (cin_iscase(p, FALSE) || cin_isscopedecl(p)
8b9a1c
! 							   || cin_islabel(30))
8b9a1c
  		    return TRUE;
8b9a1c
  		/* Need to get the line again after cin_islabel(). */
8b9a1c
  		p = ml_get_curline();
8b9a1c
--- 7857,7863 ----
8b9a1c
  	    if (try_match && keytyped == ':')
8b9a1c
  	    {
8b9a1c
  		p = ml_get_curline();
8b9a1c
! 		if (cin_iscase(p, FALSE) || cin_isscopedecl(p) || cin_islabel())
8b9a1c
  		    return TRUE;
8b9a1c
  		/* Need to get the line again after cin_islabel(). */
8b9a1c
  		p = ml_get_curline();
8b9a1c
***************
8b9a1c
*** 7868,7874 ****
8b9a1c
  		{
8b9a1c
  		    p[curwin->w_cursor.col - 1] = ' ';
8b9a1c
  		    i = (cin_iscase(p, FALSE) || cin_isscopedecl(p)
8b9a1c
! 							  || cin_islabel(30));
8b9a1c
  		    p = ml_get_curline();
8b9a1c
  		    p[curwin->w_cursor.col - 1] = ':';
8b9a1c
  		    if (i)
8b9a1c
--- 7867,7873 ----
8b9a1c
  		{
8b9a1c
  		    p[curwin->w_cursor.col - 1] = ' ';
8b9a1c
  		    i = (cin_iscase(p, FALSE) || cin_isscopedecl(p)
8b9a1c
! 							    || cin_islabel());
8b9a1c
  		    p = ml_get_curline();
8b9a1c
  		    p[curwin->w_cursor.col - 1] = ':';
8b9a1c
  		    if (i)
8b9a1c
*** ../vim-7.4.070/src/misc1.c	2013-11-05 07:12:59.000000000 +0100
8b9a1c
--- src/misc1.c	2013-11-06 03:46:59.000000000 +0100
8b9a1c
***************
8b9a1c
*** 5191,5201 ****
8b9a1c
--- 5191,5208 ----
8b9a1c
  #if defined(FEAT_CINDENT) || defined(FEAT_SYN_HL)
8b9a1c
  
8b9a1c
  static char_u	*skip_string __ARGS((char_u *p));
8b9a1c
+ static pos_T *ind_find_start_comment __ARGS((void));
8b9a1c
  
8b9a1c
  /*
8b9a1c
   * Find the start of a comment, not knowing if we are in a comment right now.
8b9a1c
   * Search starts at w_cursor.lnum and goes backwards.
8b9a1c
   */
8b9a1c
+     static pos_T *
8b9a1c
+ ind_find_start_comment()	    /* XXX */
8b9a1c
+ {
8b9a1c
+     return find_start_comment(curbuf->b_ind_maxcomment);
8b9a1c
+ }
8b9a1c
+ 
8b9a1c
      pos_T *
8b9a1c
  find_start_comment(ind_maxcomment)	    /* XXX */
8b9a1c
      int		ind_maxcomment;
8b9a1c
***************
8b9a1c
*** 5313,5319 ****
8b9a1c
  static int	cin_isdefault __ARGS((char_u *));
8b9a1c
  static char_u	*after_label __ARGS((char_u *l));
8b9a1c
  static int	get_indent_nolabel __ARGS((linenr_T lnum));
8b9a1c
! static int	skip_label __ARGS((linenr_T, char_u **pp, int ind_maxcomment));
8b9a1c
  static int	cin_first_id_amount __ARGS((void));
8b9a1c
  static int	cin_get_equal_amount __ARGS((linenr_T lnum));
8b9a1c
  static int	cin_ispreproc __ARGS((char_u *));
8b9a1c
--- 5320,5326 ----
8b9a1c
  static int	cin_isdefault __ARGS((char_u *));
8b9a1c
  static char_u	*after_label __ARGS((char_u *l));
8b9a1c
  static int	get_indent_nolabel __ARGS((linenr_T lnum));
8b9a1c
! static int	skip_label __ARGS((linenr_T, char_u **pp));
8b9a1c
  static int	cin_first_id_amount __ARGS((void));
8b9a1c
  static int	cin_get_equal_amount __ARGS((linenr_T lnum));
8b9a1c
  static int	cin_ispreproc __ARGS((char_u *));
8b9a1c
***************
8b9a1c
*** 5322,5345 ****
8b9a1c
  static int	cin_islinecomment __ARGS((char_u *));
8b9a1c
  static int	cin_isterminated __ARGS((char_u *, int, int));
8b9a1c
  static int	cin_isinit __ARGS((void));
8b9a1c
! static int	cin_isfuncdecl __ARGS((char_u **, linenr_T, linenr_T, int, int));
8b9a1c
  static int	cin_isif __ARGS((char_u *));
8b9a1c
  static int	cin_iselse __ARGS((char_u *));
8b9a1c
  static int	cin_isdo __ARGS((char_u *));
8b9a1c
! static int	cin_iswhileofdo __ARGS((char_u *, linenr_T, int));
8b9a1c
  static int	cin_is_if_for_while_before_offset __ARGS((char_u *line, int *poffset));
8b9a1c
! static int	cin_iswhileofdo_end __ARGS((int terminated, int	ind_maxparen, int ind_maxcomment));
8b9a1c
  static int	cin_isbreak __ARGS((char_u *));
8b9a1c
  static int	cin_is_cpp_baseclass __ARGS((colnr_T *col));
8b9a1c
! static int	get_baseclass_amount __ARGS((int col, int ind_maxparen, int ind_maxcomment, int ind_cpp_baseclass));
8b9a1c
  static int	cin_ends_in __ARGS((char_u *, char_u *, char_u *));
8b9a1c
  static int	cin_starts_with __ARGS((char_u *s, char *word));
8b9a1c
  static int	cin_skip2pos __ARGS((pos_T *trypos));
8b9a1c
! static pos_T	*find_start_brace __ARGS((int));
8b9a1c
! static pos_T	*find_match_paren __ARGS((int, int));
8b9a1c
! static int	corr_ind_maxparen __ARGS((int ind_maxparen, pos_T *startpos));
8b9a1c
  static int	find_last_paren __ARGS((char_u *l, int start, int end));
8b9a1c
! static int	find_match __ARGS((int lookfor, linenr_T ourscope, int ind_maxparen, int ind_maxcomment));
8b9a1c
  static int	cin_is_cpp_namespace __ARGS((char_u *));
8b9a1c
  
8b9a1c
  /*
8b9a1c
--- 5329,5352 ----
8b9a1c
  static int	cin_islinecomment __ARGS((char_u *));
8b9a1c
  static int	cin_isterminated __ARGS((char_u *, int, int));
8b9a1c
  static int	cin_isinit __ARGS((void));
8b9a1c
! static int	cin_isfuncdecl __ARGS((char_u **, linenr_T, linenr_T));
8b9a1c
  static int	cin_isif __ARGS((char_u *));
8b9a1c
  static int	cin_iselse __ARGS((char_u *));
8b9a1c
  static int	cin_isdo __ARGS((char_u *));
8b9a1c
! static int	cin_iswhileofdo __ARGS((char_u *, linenr_T));
8b9a1c
  static int	cin_is_if_for_while_before_offset __ARGS((char_u *line, int *poffset));
8b9a1c
! static int	cin_iswhileofdo_end __ARGS((int terminated));
8b9a1c
  static int	cin_isbreak __ARGS((char_u *));
8b9a1c
  static int	cin_is_cpp_baseclass __ARGS((colnr_T *col));
8b9a1c
! static int	get_baseclass_amount __ARGS((int col));
8b9a1c
  static int	cin_ends_in __ARGS((char_u *, char_u *, char_u *));
8b9a1c
  static int	cin_starts_with __ARGS((char_u *s, char *word));
8b9a1c
  static int	cin_skip2pos __ARGS((pos_T *trypos));
8b9a1c
! static pos_T	*find_start_brace __ARGS((void));
8b9a1c
! static pos_T	*find_match_paren __ARGS((int));
8b9a1c
! static int	corr_ind_maxparen __ARGS((pos_T *startpos));
8b9a1c
  static int	find_last_paren __ARGS((char_u *l, int start, int end));
8b9a1c
! static int	find_match __ARGS((int lookfor, linenr_T ourscope));
8b9a1c
  static int	cin_is_cpp_namespace __ARGS((char_u *));
8b9a1c
  
8b9a1c
  /*
8b9a1c
***************
8b9a1c
*** 5444,5451 ****
8b9a1c
   * Note: curwin->w_cursor must be where we are looking for the label.
8b9a1c
   */
8b9a1c
      int
8b9a1c
! cin_islabel(ind_maxcomment)		/* XXX */
8b9a1c
!     int		ind_maxcomment;
8b9a1c
  {
8b9a1c
      char_u	*s;
8b9a1c
  
8b9a1c
--- 5451,5457 ----
8b9a1c
   * Note: curwin->w_cursor must be where we are looking for the label.
8b9a1c
   */
8b9a1c
      int
8b9a1c
! cin_islabel()		/* XXX */
8b9a1c
  {
8b9a1c
      char_u	*s;
8b9a1c
  
8b9a1c
***************
8b9a1c
*** 5479,5485 ****
8b9a1c
  	     * If we're in a comment now, skip to the start of the comment.
8b9a1c
  	     */
8b9a1c
  	    curwin->w_cursor.col = 0;
8b9a1c
! 	    if ((trypos = find_start_comment(ind_maxcomment)) != NULL) /* XXX */
8b9a1c
  		curwin->w_cursor = *trypos;
8b9a1c
  
8b9a1c
  	    line = ml_get_curline();
8b9a1c
--- 5485,5491 ----
8b9a1c
  	     * If we're in a comment now, skip to the start of the comment.
8b9a1c
  	     */
8b9a1c
  	    curwin->w_cursor.col = 0;
8b9a1c
! 	    if ((trypos = ind_find_start_comment()) != NULL) /* XXX */
8b9a1c
  		curwin->w_cursor = *trypos;
8b9a1c
  
8b9a1c
  	    line = ml_get_curline();
8b9a1c
***************
8b9a1c
*** 5725,5734 ****
8b9a1c
   *		^
8b9a1c
   */
8b9a1c
      static int
8b9a1c
! skip_label(lnum, pp, ind_maxcomment)
8b9a1c
      linenr_T	lnum;
8b9a1c
      char_u	**pp;
8b9a1c
-     int		ind_maxcomment;
8b9a1c
  {
8b9a1c
      char_u	*l;
8b9a1c
      int		amount;
8b9a1c
--- 5731,5739 ----
8b9a1c
   *		^
8b9a1c
   */
8b9a1c
      static int
8b9a1c
! skip_label(lnum, pp)
8b9a1c
      linenr_T	lnum;
8b9a1c
      char_u	**pp;
8b9a1c
  {
8b9a1c
      char_u	*l;
8b9a1c
      int		amount;
8b9a1c
***************
8b9a1c
*** 5738,5745 ****
8b9a1c
      curwin->w_cursor.lnum = lnum;
8b9a1c
      l = ml_get_curline();
8b9a1c
  				    /* XXX */
8b9a1c
!     if (cin_iscase(l, FALSE) || cin_isscopedecl(l)
8b9a1c
! 					       || cin_islabel(ind_maxcomment))
8b9a1c
      {
8b9a1c
  	amount = get_indent_nolabel(lnum);
8b9a1c
  	l = after_label(ml_get_curline());
8b9a1c
--- 5743,5749 ----
8b9a1c
      curwin->w_cursor.lnum = lnum;
8b9a1c
      l = ml_get_curline();
8b9a1c
  				    /* XXX */
8b9a1c
!     if (cin_iscase(l, FALSE) || cin_isscopedecl(l) || cin_islabel())
8b9a1c
      {
8b9a1c
  	amount = get_indent_nolabel(lnum);
8b9a1c
  	l = after_label(ml_get_curline());
8b9a1c
***************
8b9a1c
*** 5983,5994 ****
8b9a1c
   * "min_lnum" is the line before which we will not be looking.
8b9a1c
   */
8b9a1c
      static int
8b9a1c
! cin_isfuncdecl(sp, first_lnum, min_lnum, ind_maxparen, ind_maxcomment)
8b9a1c
      char_u	**sp;
8b9a1c
      linenr_T	first_lnum;
8b9a1c
      linenr_T	min_lnum;
8b9a1c
-     int		ind_maxparen;
8b9a1c
-     int		ind_maxcomment;
8b9a1c
  {
8b9a1c
      char_u	*s;
8b9a1c
      linenr_T	lnum = first_lnum;
8b9a1c
--- 5987,5996 ----
8b9a1c
   * "min_lnum" is the line before which we will not be looking.
8b9a1c
   */
8b9a1c
      static int
8b9a1c
! cin_isfuncdecl(sp, first_lnum, min_lnum)
8b9a1c
      char_u	**sp;
8b9a1c
      linenr_T	first_lnum;
8b9a1c
      linenr_T	min_lnum;
8b9a1c
  {
8b9a1c
      char_u	*s;
8b9a1c
      linenr_T	lnum = first_lnum;
8b9a1c
***************
8b9a1c
*** 6002,6008 ****
8b9a1c
  	s = *sp;
8b9a1c
  
8b9a1c
      if (find_last_paren(s, '(', ')')
8b9a1c
! 	&& (trypos = find_match_paren(ind_maxparen, ind_maxcomment)) != NULL)
8b9a1c
      {
8b9a1c
  	lnum = trypos->lnum;
8b9a1c
  	if (lnum < min_lnum)
8b9a1c
--- 6004,6010 ----
8b9a1c
  	s = *sp;
8b9a1c
  
8b9a1c
      if (find_last_paren(s, '(', ')')
8b9a1c
! 	&& (trypos = find_match_paren(curbuf->b_ind_maxparen)) != NULL)
8b9a1c
      {
8b9a1c
  	lnum = trypos->lnum;
8b9a1c
  	if (lnum < min_lnum)
8b9a1c
***************
8b9a1c
*** 6110,6119 ****
8b9a1c
   * ')' and ';'. The condition may be spread over several lines.
8b9a1c
   */
8b9a1c
      static int
8b9a1c
! cin_iswhileofdo(p, lnum, ind_maxparen)	    /* XXX */
8b9a1c
      char_u	*p;
8b9a1c
      linenr_T	lnum;
8b9a1c
-     int		ind_maxparen;
8b9a1c
  {
8b9a1c
      pos_T	cursor_save;
8b9a1c
      pos_T	*trypos;
8b9a1c
--- 6112,6120 ----
8b9a1c
   * ')' and ';'. The condition may be spread over several lines.
8b9a1c
   */
8b9a1c
      static int
8b9a1c
! cin_iswhileofdo(p, lnum)	    /* XXX */
8b9a1c
      char_u	*p;
8b9a1c
      linenr_T	lnum;
8b9a1c
  {
8b9a1c
      pos_T	cursor_save;
8b9a1c
      pos_T	*trypos;
8b9a1c
***************
8b9a1c
*** 6133,6139 ****
8b9a1c
  	    ++p;
8b9a1c
  	    ++curwin->w_cursor.col;
8b9a1c
  	}
8b9a1c
! 	if ((trypos = findmatchlimit(NULL, 0, 0, ind_maxparen)) != NULL
8b9a1c
  		&& *cin_skipcomment(ml_get_pos(trypos) + 1) == ';')
8b9a1c
  	    retval = TRUE;
8b9a1c
  	curwin->w_cursor = cursor_save;
8b9a1c
--- 6134,6141 ----
8b9a1c
  	    ++p;
8b9a1c
  	    ++curwin->w_cursor.col;
8b9a1c
  	}
8b9a1c
! 	if ((trypos = findmatchlimit(NULL, 0, 0,
8b9a1c
! 					      curbuf->b_ind_maxparen)) != NULL
8b9a1c
  		&& *cin_skipcomment(ml_get_pos(trypos) + 1) == ';')
8b9a1c
  	    retval = TRUE;
8b9a1c
  	curwin->w_cursor = cursor_save;
8b9a1c
***************
8b9a1c
*** 6196,6205 ****
8b9a1c
   * Adjust the cursor to the line with "while".
8b9a1c
   */
8b9a1c
      static int
8b9a1c
! cin_iswhileofdo_end(terminated, ind_maxparen, ind_maxcomment)
8b9a1c
      int	    terminated;
8b9a1c
-     int	    ind_maxparen;
8b9a1c
-     int	    ind_maxcomment;
8b9a1c
  {
8b9a1c
      char_u	*line;
8b9a1c
      char_u	*p;
8b9a1c
--- 6198,6205 ----
8b9a1c
   * Adjust the cursor to the line with "while".
8b9a1c
   */
8b9a1c
      static int
8b9a1c
! cin_iswhileofdo_end(terminated)
8b9a1c
      int	    terminated;
8b9a1c
  {
8b9a1c
      char_u	*line;
8b9a1c
      char_u	*p;
8b9a1c
***************
8b9a1c
*** 6223,6229 ****
8b9a1c
  		 * before the matching '('.  XXX */
8b9a1c
  		i = (int)(p - line);
8b9a1c
  		curwin->w_cursor.col = i;
8b9a1c
! 		trypos = find_match_paren(ind_maxparen, ind_maxcomment);
8b9a1c
  		if (trypos != NULL)
8b9a1c
  		{
8b9a1c
  		    s = cin_skipcomment(ml_get(trypos->lnum));
8b9a1c
--- 6223,6229 ----
8b9a1c
  		 * before the matching '('.  XXX */
8b9a1c
  		i = (int)(p - line);
8b9a1c
  		curwin->w_cursor.col = i;
8b9a1c
! 		trypos = find_match_paren(curbuf->b_ind_maxparen);
8b9a1c
  		if (trypos != NULL)
8b9a1c
  		{
8b9a1c
  		    s = cin_skipcomment(ml_get(trypos->lnum));
8b9a1c
***************
8b9a1c
*** 6415,6425 ****
8b9a1c
  }
8b9a1c
  
8b9a1c
      static int
8b9a1c
! get_baseclass_amount(col, ind_maxparen, ind_maxcomment, ind_cpp_baseclass)
8b9a1c
      int		col;
8b9a1c
-     int		ind_maxparen;
8b9a1c
-     int		ind_maxcomment;
8b9a1c
-     int		ind_cpp_baseclass;
8b9a1c
  {
8b9a1c
      int		amount;
8b9a1c
      colnr_T	vcol;
8b9a1c
--- 6415,6422 ----
8b9a1c
  }
8b9a1c
  
8b9a1c
      static int
8b9a1c
! get_baseclass_amount(col)
8b9a1c
      int		col;
8b9a1c
  {
8b9a1c
      int		amount;
8b9a1c
      colnr_T	vcol;
8b9a1c
***************
8b9a1c
*** 6429,6439 ****
8b9a1c
      {
8b9a1c
  	amount = get_indent();
8b9a1c
  	if (find_last_paren(ml_get_curline(), '(', ')')
8b9a1c
! 		&& (trypos = find_match_paren(ind_maxparen,
8b9a1c
! 						     ind_maxcomment)) != NULL)
8b9a1c
  	    amount = get_indent_lnum(trypos->lnum); /* XXX */
8b9a1c
  	if (!cin_ends_in(ml_get_curline(), (char_u *)",", NULL))
8b9a1c
! 	    amount += ind_cpp_baseclass;
8b9a1c
      }
8b9a1c
      else
8b9a1c
      {
8b9a1c
--- 6426,6435 ----
8b9a1c
      {
8b9a1c
  	amount = get_indent();
8b9a1c
  	if (find_last_paren(ml_get_curline(), '(', ')')
8b9a1c
! 		&& (trypos = find_match_paren(curbuf->b_ind_maxparen)) != NULL)
8b9a1c
  	    amount = get_indent_lnum(trypos->lnum); /* XXX */
8b9a1c
  	if (!cin_ends_in(ml_get_curline(), (char_u *)",", NULL))
8b9a1c
! 	    amount += curbuf->b_ind_cpp_baseclass;
8b9a1c
      }
8b9a1c
      else
8b9a1c
      {
8b9a1c
***************
8b9a1c
*** 6441,6448 ****
8b9a1c
  	getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL);
8b9a1c
  	amount = (int)vcol;
8b9a1c
      }
8b9a1c
!     if (amount < ind_cpp_baseclass)
8b9a1c
! 	amount = ind_cpp_baseclass;
8b9a1c
      return amount;
8b9a1c
  }
8b9a1c
  
8b9a1c
--- 6437,6444 ----
8b9a1c
  	getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL);
8b9a1c
  	amount = (int)vcol;
8b9a1c
      }
8b9a1c
!     if (amount < curbuf->b_ind_cpp_baseclass)
8b9a1c
! 	amount = curbuf->b_ind_cpp_baseclass;
8b9a1c
      return amount;
8b9a1c
  }
8b9a1c
  
8b9a1c
***************
8b9a1c
*** 6526,6533 ****
8b9a1c
  /* }	    */
8b9a1c
  
8b9a1c
      static pos_T *
8b9a1c
! find_start_brace(ind_maxcomment)	    /* XXX */
8b9a1c
!     int		ind_maxcomment;
8b9a1c
  {
8b9a1c
      pos_T	cursor_save;
8b9a1c
      pos_T	*trypos;
8b9a1c
--- 6522,6528 ----
8b9a1c
  /* }	    */
8b9a1c
  
8b9a1c
      static pos_T *
8b9a1c
! find_start_brace()	    /* XXX */
8b9a1c
  {
8b9a1c
      pos_T	cursor_save;
8b9a1c
      pos_T	*trypos;
8b9a1c
***************
8b9a1c
*** 6543,6549 ****
8b9a1c
  	pos = NULL;
8b9a1c
  	/* ignore the { if it's in a // or / *  * / comment */
8b9a1c
  	if ((colnr_T)cin_skip2pos(trypos) == trypos->col
8b9a1c
! 		&& (pos = find_start_comment(ind_maxcomment)) == NULL) /* XXX */
8b9a1c
  	    break;
8b9a1c
  	if (pos != NULL)
8b9a1c
  	    curwin->w_cursor.lnum = pos->lnum;
8b9a1c
--- 6538,6544 ----
8b9a1c
  	pos = NULL;
8b9a1c
  	/* ignore the { if it's in a // or / *  * / comment */
8b9a1c
  	if ((colnr_T)cin_skip2pos(trypos) == trypos->col
8b9a1c
! 		       && (pos = ind_find_start_comment()) == NULL) /* XXX */
8b9a1c
  	    break;
8b9a1c
  	if (pos != NULL)
8b9a1c
  	    curwin->w_cursor.lnum = pos->lnum;
8b9a1c
***************
8b9a1c
*** 6557,6565 ****
8b9a1c
   * Return NULL if no match found.
8b9a1c
   */
8b9a1c
      static pos_T *
8b9a1c
! find_match_paren(ind_maxparen, ind_maxcomment)	    /* XXX */
8b9a1c
      int		ind_maxparen;
8b9a1c
-     int		ind_maxcomment;
8b9a1c
  {
8b9a1c
      pos_T	cursor_save;
8b9a1c
      pos_T	*trypos;
8b9a1c
--- 6552,6559 ----
8b9a1c
   * Return NULL if no match found.
8b9a1c
   */
8b9a1c
      static pos_T *
8b9a1c
! find_match_paren(ind_maxparen)	    /* XXX */
8b9a1c
      int		ind_maxparen;
8b9a1c
  {
8b9a1c
      pos_T	cursor_save;
8b9a1c
      pos_T	*trypos;
8b9a1c
***************
8b9a1c
*** 6576,6582 ****
8b9a1c
  	    pos_copy = *trypos;	    /* copy trypos, findmatch will change it */
8b9a1c
  	    trypos = &pos_copy;
8b9a1c
  	    curwin->w_cursor = *trypos;
8b9a1c
! 	    if (find_start_comment(ind_maxcomment) != NULL) /* XXX */
8b9a1c
  		trypos = NULL;
8b9a1c
  	}
8b9a1c
      }
8b9a1c
--- 6570,6576 ----
8b9a1c
  	    pos_copy = *trypos;	    /* copy trypos, findmatch will change it */
8b9a1c
  	    trypos = &pos_copy;
8b9a1c
  	    curwin->w_cursor = *trypos;
8b9a1c
! 	    if (ind_find_start_comment() != NULL) /* XXX */
8b9a1c
  		trypos = NULL;
8b9a1c
  	}
8b9a1c
      }
8b9a1c
***************
8b9a1c
*** 6591,6605 ****
8b9a1c
   * looking a few lines further.
8b9a1c
   */
8b9a1c
      static int
8b9a1c
! corr_ind_maxparen(ind_maxparen, startpos)
8b9a1c
!     int		ind_maxparen;
8b9a1c
      pos_T	*startpos;
8b9a1c
  {
8b9a1c
      long	n = (long)startpos->lnum - (long)curwin->w_cursor.lnum;
8b9a1c
  
8b9a1c
!     if (n > 0 && n < ind_maxparen / 2)
8b9a1c
! 	return ind_maxparen - (int)n;
8b9a1c
!     return ind_maxparen;
8b9a1c
  }
8b9a1c
  
8b9a1c
  /*
8b9a1c
--- 6585,6598 ----
8b9a1c
   * looking a few lines further.
8b9a1c
   */
8b9a1c
      static int
8b9a1c
! corr_ind_maxparen(startpos)
8b9a1c
      pos_T	*startpos;
8b9a1c
  {
8b9a1c
      long	n = (long)startpos->lnum - (long)curwin->w_cursor.lnum;
8b9a1c
  
8b9a1c
!     if (n > 0 && n < curbuf->b_ind_maxparen / 2)
8b9a1c
! 	return curbuf->b_ind_maxparen - (int)n;
8b9a1c
!     return curbuf->b_ind_maxparen;
8b9a1c
  }
8b9a1c
  
8b9a1c
  /*
8b9a1c
***************
8b9a1c
*** 6937,6943 ****
8b9a1c
  
8b9a1c
      curwin->w_cursor.col = 0;
8b9a1c
  
8b9a1c
!     original_line_islabel = cin_islabel(curbuf->b_ind_maxcomment);  /* XXX */
8b9a1c
  
8b9a1c
      /*
8b9a1c
       * #defines and so on always go at the left when included in 'cinkeys'.
8b9a1c
--- 6930,6936 ----
8b9a1c
  
8b9a1c
      curwin->w_cursor.col = 0;
8b9a1c
  
8b9a1c
!     original_line_islabel = cin_islabel();  /* XXX */
8b9a1c
  
8b9a1c
      /*
8b9a1c
       * #defines and so on always go at the left when included in 'cinkeys'.
8b9a1c
***************
8b9a1c
*** 6973,6979 ****
8b9a1c
       * comment, try using the 'comments' option.
8b9a1c
       */
8b9a1c
      else if (!cin_iscomment(theline)
8b9a1c
! 	    && (trypos = find_start_comment(curbuf->b_ind_maxcomment)) != NULL)
8b9a1c
  	/* XXX */
8b9a1c
      {
8b9a1c
  	int	lead_start_len = 2;
8b9a1c
--- 6966,6972 ----
8b9a1c
       * comment, try using the 'comments' option.
8b9a1c
       */
8b9a1c
      else if (!cin_iscomment(theline)
8b9a1c
! 			       && (trypos = ind_find_start_comment()) != NULL)
8b9a1c
  	/* XXX */
8b9a1c
      {
8b9a1c
  	int	lead_start_len = 2;
8b9a1c
***************
8b9a1c
*** 7126,7136 ****
8b9a1c
      /*
8b9a1c
       * Are we inside parentheses or braces?
8b9a1c
       */						    /* XXX */
8b9a1c
!     else if (((trypos = find_match_paren(curbuf->b_ind_maxparen,
8b9a1c
! 					    curbuf->b_ind_maxcomment)) != NULL
8b9a1c
  		&& curbuf->b_ind_java == 0)
8b9a1c
! 	    || (tryposBrace =
8b9a1c
! 			   find_start_brace(curbuf->b_ind_maxcomment)) != NULL
8b9a1c
  	    || trypos != NULL)
8b9a1c
      {
8b9a1c
        if (trypos != NULL && tryposBrace != NULL)
8b9a1c
--- 7119,7127 ----
8b9a1c
      /*
8b9a1c
       * Are we inside parentheses or braces?
8b9a1c
       */						    /* XXX */
8b9a1c
!     else if (((trypos = find_match_paren(curbuf->b_ind_maxparen)) != NULL
8b9a1c
  		&& curbuf->b_ind_java == 0)
8b9a1c
! 	    || (tryposBrace = find_start_brace()) != NULL
8b9a1c
  	    || trypos != NULL)
8b9a1c
      {
8b9a1c
        if (trypos != NULL && tryposBrace != NULL)
8b9a1c
***************
8b9a1c
*** 7170,7177 ****
8b9a1c
  		curwin->w_cursor.lnum = lnum;
8b9a1c
  
8b9a1c
  		/* Skip a comment. XXX */
8b9a1c
! 		if ((trypos = find_start_comment(curbuf->b_ind_maxcomment))
8b9a1c
! 								      != NULL)
8b9a1c
  		{
8b9a1c
  		    lnum = trypos->lnum + 1;
8b9a1c
  		    continue;
8b9a1c
--- 7161,7167 ----
8b9a1c
  		curwin->w_cursor.lnum = lnum;
8b9a1c
  
8b9a1c
  		/* Skip a comment. XXX */
8b9a1c
! 		if ((trypos = ind_find_start_comment()) != NULL)
8b9a1c
  		{
8b9a1c
  		    lnum = trypos->lnum + 1;
8b9a1c
  		    continue;
8b9a1c
***************
8b9a1c
*** 7179,7186 ****
8b9a1c
  
8b9a1c
  		/* XXX */
8b9a1c
  		if ((trypos = find_match_paren(
8b9a1c
! 		       corr_ind_maxparen(curbuf->b_ind_maxparen, &cur_curpos),
8b9a1c
! 					    curbuf->b_ind_maxcomment)) != NULL
8b9a1c
  			&& trypos->lnum == our_paren_pos.lnum
8b9a1c
  			&& trypos->col == our_paren_pos.col)
8b9a1c
  		{
8b9a1c
--- 7169,7175 ----
8b9a1c
  
8b9a1c
  		/* XXX */
8b9a1c
  		if ((trypos = find_match_paren(
8b9a1c
! 			corr_ind_maxparen(&cur_curpos))) != NULL
8b9a1c
  			&& trypos->lnum == our_paren_pos.lnum
8b9a1c
  			&& trypos->col == our_paren_pos.col)
8b9a1c
  		{
8b9a1c
***************
8b9a1c
*** 7223,7230 ****
8b9a1c
  		    curwin->w_cursor.lnum = outermost.lnum;
8b9a1c
  		    curwin->w_cursor.col = outermost.col;
8b9a1c
  
8b9a1c
! 		    trypos = find_match_paren(curbuf->b_ind_maxparen,
8b9a1c
! 						    curbuf->b_ind_maxcomment);
8b9a1c
  		} while (trypos && trypos->lnum == outermost.lnum);
8b9a1c
  
8b9a1c
  		curwin->w_cursor = cursor_save;
8b9a1c
--- 7212,7218 ----
8b9a1c
  		    curwin->w_cursor.lnum = outermost.lnum;
8b9a1c
  		    curwin->w_cursor.col = outermost.col;
8b9a1c
  
8b9a1c
! 		    trypos = find_match_paren(curbuf->b_ind_maxparen);
8b9a1c
  		} while (trypos && trypos->lnum == outermost.lnum);
8b9a1c
  
8b9a1c
  		curwin->w_cursor = cursor_save;
8b9a1c
***************
8b9a1c
*** 7235,7242 ****
8b9a1c
  		    cin_is_if_for_while_before_offset(line, &outermost.col);
8b9a1c
  	    }
8b9a1c
  
8b9a1c
! 	    amount = skip_label(our_paren_pos.lnum, &look,
8b9a1c
! 						    curbuf->b_ind_maxcomment);
8b9a1c
  	    look = skipwhite(look);
8b9a1c
  	    if (*look == '(')
8b9a1c
  	    {
8b9a1c
--- 7223,7229 ----
8b9a1c
  		    cin_is_if_for_while_before_offset(line, &outermost.col);
8b9a1c
  	    }
8b9a1c
  
8b9a1c
! 	    amount = skip_label(our_paren_pos.lnum, &look;;
8b9a1c
  	    look = skipwhite(look);
8b9a1c
  	    if (*look == '(')
8b9a1c
  	    {
8b9a1c
***************
8b9a1c
*** 7366,7373 ****
8b9a1c
  		{
8b9a1c
  		    curwin->w_cursor.lnum = our_paren_pos.lnum;
8b9a1c
  		    curwin->w_cursor.col = col;
8b9a1c
! 		    if (find_match_paren(curbuf->b_ind_maxparen,
8b9a1c
! 					    curbuf->b_ind_maxcomment) != NULL)
8b9a1c
  			amount += curbuf->b_ind_unclosed2;
8b9a1c
  		    else
8b9a1c
  		    {
8b9a1c
--- 7353,7359 ----
8b9a1c
  		{
8b9a1c
  		    curwin->w_cursor.lnum = our_paren_pos.lnum;
8b9a1c
  		    curwin->w_cursor.col = col;
8b9a1c
! 		    if (find_match_paren(curbuf->b_ind_maxparen) != NULL)
8b9a1c
  			amount += curbuf->b_ind_unclosed2;
8b9a1c
  		    else
8b9a1c
  		    {
8b9a1c
***************
8b9a1c
*** 7435,7442 ****
8b9a1c
  	     */
8b9a1c
  	    lnum = ourscope;
8b9a1c
  	    if (find_last_paren(start, '(', ')')
8b9a1c
! 		    && (trypos = find_match_paren(curbuf->b_ind_maxparen,
8b9a1c
! 					   curbuf->b_ind_maxcomment)) != NULL)
8b9a1c
  		lnum = trypos->lnum;
8b9a1c
  
8b9a1c
  	    /*
8b9a1c
--- 7421,7428 ----
8b9a1c
  	     */
8b9a1c
  	    lnum = ourscope;
8b9a1c
  	    if (find_last_paren(start, '(', ')')
8b9a1c
! 			&& (trypos = find_match_paren(curbuf->b_ind_maxparen))
8b9a1c
! 								      != NULL)
8b9a1c
  		lnum = trypos->lnum;
8b9a1c
  
8b9a1c
  	    /*
8b9a1c
***************
8b9a1c
*** 7449,7455 ****
8b9a1c
  			   && cin_iscase(skipwhite(ml_get_curline()), FALSE)))
8b9a1c
  		amount = get_indent();
8b9a1c
  	    else
8b9a1c
! 		amount = skip_label(lnum, &l, curbuf->b_ind_maxcomment);
8b9a1c
  
8b9a1c
  	    start_brace = BRACE_AT_END;
8b9a1c
  	}
8b9a1c
--- 7435,7441 ----
8b9a1c
  			   && cin_iscase(skipwhite(ml_get_curline()), FALSE)))
8b9a1c
  		amount = get_indent();
8b9a1c
  	    else
8b9a1c
! 		amount = skip_label(lnum, &l);
8b9a1c
  
8b9a1c
  	    start_brace = BRACE_AT_END;
8b9a1c
  	}
8b9a1c
***************
8b9a1c
*** 7478,7491 ****
8b9a1c
  	    lookfor = LOOKFOR_INITIAL;
8b9a1c
  	    if (cin_iselse(theline))
8b9a1c
  		lookfor = LOOKFOR_IF;
8b9a1c
! 	    else if (cin_iswhileofdo(theline, cur_curpos.lnum,
8b9a1c
! 					    curbuf->b_ind_maxparen)) /* XXX */
8b9a1c
  		lookfor = LOOKFOR_DO;
8b9a1c
  	    if (lookfor != LOOKFOR_INITIAL)
8b9a1c
  	    {
8b9a1c
  		curwin->w_cursor.lnum = cur_curpos.lnum;
8b9a1c
! 		if (find_match(lookfor, ourscope, curbuf->b_ind_maxparen,
8b9a1c
! 					      curbuf->b_ind_maxcomment) == OK)
8b9a1c
  		{
8b9a1c
  		    amount = get_indent();	/* XXX */
8b9a1c
  		    goto theend;
8b9a1c
--- 7464,7475 ----
8b9a1c
  	    lookfor = LOOKFOR_INITIAL;
8b9a1c
  	    if (cin_iselse(theline))
8b9a1c
  		lookfor = LOOKFOR_IF;
8b9a1c
! 	    else if (cin_iswhileofdo(theline, cur_curpos.lnum)) /* XXX */
8b9a1c
  		lookfor = LOOKFOR_DO;
8b9a1c
  	    if (lookfor != LOOKFOR_INITIAL)
8b9a1c
  	    {
8b9a1c
  		curwin->w_cursor.lnum = cur_curpos.lnum;
8b9a1c
! 		if (find_match(lookfor, ourscope) == OK)
8b9a1c
  		{
8b9a1c
  		    amount = get_indent();	/* XXX */
8b9a1c
  		    goto theend;
8b9a1c
***************
8b9a1c
*** 7611,7617 ****
8b9a1c
  			 * If we're in a comment now, skip to the start of the
8b9a1c
  			 * comment.
8b9a1c
  			 */
8b9a1c
! 			trypos = find_start_comment(curbuf->b_ind_maxcomment);
8b9a1c
  			if (trypos != NULL)
8b9a1c
  			{
8b9a1c
  			    curwin->w_cursor.lnum = trypos->lnum + 1;
8b9a1c
--- 7595,7601 ----
8b9a1c
  			 * If we're in a comment now, skip to the start of the
8b9a1c
  			 * comment.
8b9a1c
  			 */
8b9a1c
! 			trypos = ind_find_start_comment();
8b9a1c
  			if (trypos != NULL)
8b9a1c
  			{
8b9a1c
  			    curwin->w_cursor.lnum = trypos->lnum + 1;
8b9a1c
***************
8b9a1c
*** 7636,7644 ****
8b9a1c
  			 * (it's a variable declaration).
8b9a1c
  			 */
8b9a1c
  			if (start_brace != BRACE_IN_COL0
8b9a1c
! 				|| !cin_isfuncdecl(&l, curwin->w_cursor.lnum,
8b9a1c
! 					     0, curbuf->b_ind_maxparen,
8b9a1c
! 						    curbuf->b_ind_maxcomment))
8b9a1c
  			{
8b9a1c
  			    /* if the line is terminated with another ','
8b9a1c
  			     * it is a continued variable initialization.
8b9a1c
--- 7620,7626 ----
8b9a1c
  			 * (it's a variable declaration).
8b9a1c
  			 */
8b9a1c
  			if (start_brace != BRACE_IN_COL0
8b9a1c
! 			     || !cin_isfuncdecl(&l, curwin->w_cursor.lnum, 0))
8b9a1c
  			{
8b9a1c
  			    /* if the line is terminated with another ','
8b9a1c
  			     * it is a continued variable initialization.
8b9a1c
***************
8b9a1c
*** 7670,7681 ****
8b9a1c
  			    trypos = NULL;
8b9a1c
  			    if (find_last_paren(l, '(', ')'))
8b9a1c
  				trypos = find_match_paren(
8b9a1c
! 						curbuf->b_ind_maxparen,
8b9a1c
! 						curbuf->b_ind_maxcomment);
8b9a1c
  
8b9a1c
  			    if (trypos == NULL && find_last_paren(l, '{', '}'))
8b9a1c
! 				trypos = find_start_brace(
8b9a1c
! 						    curbuf->b_ind_maxcomment);
8b9a1c
  
8b9a1c
  			    if (trypos != NULL)
8b9a1c
  			    {
8b9a1c
--- 7652,7661 ----
8b9a1c
  			    trypos = NULL;
8b9a1c
  			    if (find_last_paren(l, '(', ')'))
8b9a1c
  				trypos = find_match_paren(
8b9a1c
! 						      curbuf->b_ind_maxparen);
8b9a1c
  
8b9a1c
  			    if (trypos == NULL && find_last_paren(l, '{', '}'))
8b9a1c
! 				trypos = find_start_brace();
8b9a1c
  
8b9a1c
  			    if (trypos != NULL)
8b9a1c
  			    {
8b9a1c
***************
8b9a1c
*** 7733,7740 ****
8b9a1c
  
8b9a1c
  			    /* If we're in a comment now, skip to the start of
8b9a1c
  			     * the comment. */
8b9a1c
! 			    trypos = find_start_comment(
8b9a1c
! 						    curbuf->b_ind_maxcomment);
8b9a1c
  			    if (trypos != NULL)
8b9a1c
  			    {
8b9a1c
  				curwin->w_cursor.lnum = trypos->lnum + 1;
8b9a1c
--- 7713,7719 ----
8b9a1c
  
8b9a1c
  			    /* If we're in a comment now, skip to the start of
8b9a1c
  			     * the comment. */
8b9a1c
! 			    trypos = ind_find_start_comment();
8b9a1c
  			    if (trypos != NULL)
8b9a1c
  			    {
8b9a1c
  				curwin->w_cursor.lnum = trypos->lnum + 1;
8b9a1c
***************
8b9a1c
*** 7764,7771 ****
8b9a1c
  		/*
8b9a1c
  		 * If we're in a comment now, skip to the start of the comment.
8b9a1c
  		 */					    /* XXX */
8b9a1c
! 		if ((trypos = find_start_comment(curbuf->b_ind_maxcomment))
8b9a1c
! 								      != NULL)
8b9a1c
  		{
8b9a1c
  		    curwin->w_cursor.lnum = trypos->lnum + 1;
8b9a1c
  		    curwin->w_cursor.col = 0;
8b9a1c
--- 7743,7749 ----
8b9a1c
  		/*
8b9a1c
  		 * If we're in a comment now, skip to the start of the comment.
8b9a1c
  		 */					    /* XXX */
8b9a1c
! 		if ((trypos = ind_find_start_comment()) != NULL)
8b9a1c
  		{
8b9a1c
  		    curwin->w_cursor.lnum = trypos->lnum + 1;
8b9a1c
  		    curwin->w_cursor.col = 0;
8b9a1c
***************
8b9a1c
*** 7819,7826 ****
8b9a1c
  			 * Check that this case label is not for another
8b9a1c
  			 * switch()
8b9a1c
  			 */				    /* XXX */
8b9a1c
! 			if ((trypos = find_start_brace(
8b9a1c
! 					    curbuf->b_ind_maxcomment)) == NULL
8b9a1c
  						  || trypos->lnum == ourscope)
8b9a1c
  			{
8b9a1c
  			    amount = get_indent();	/* XXX */
8b9a1c
--- 7797,7803 ----
8b9a1c
  			 * Check that this case label is not for another
8b9a1c
  			 * switch()
8b9a1c
  			 */				    /* XXX */
8b9a1c
! 			if ((trypos = find_start_brace()) == NULL
8b9a1c
  						  || trypos->lnum == ourscope)
8b9a1c
  			{
8b9a1c
  			    amount = get_indent();	/* XXX */
8b9a1c
***************
8b9a1c
*** 7894,7901 ****
8b9a1c
  		 */
8b9a1c
  		if (lookfor == LOOKFOR_CASE || lookfor == LOOKFOR_SCOPEDECL)
8b9a1c
  		{
8b9a1c
! 		    if (find_last_paren(l, '{', '}') && (trypos =
8b9a1c
! 			  find_start_brace(curbuf->b_ind_maxcomment)) != NULL)
8b9a1c
  		    {
8b9a1c
  			curwin->w_cursor.lnum = trypos->lnum + 1;
8b9a1c
  			curwin->w_cursor.col = 0;
8b9a1c
--- 7871,7878 ----
8b9a1c
  		 */
8b9a1c
  		if (lookfor == LOOKFOR_CASE || lookfor == LOOKFOR_SCOPEDECL)
8b9a1c
  		{
8b9a1c
! 		    if (find_last_paren(l, '{', '}')
8b9a1c
! 				     && (trypos = find_start_brace()) != NULL)
8b9a1c
  		    {
8b9a1c
  			curwin->w_cursor.lnum = trypos->lnum + 1;
8b9a1c
  			curwin->w_cursor.col = 0;
8b9a1c
***************
8b9a1c
*** 7906,7912 ****
8b9a1c
  		/*
8b9a1c
  		 * Ignore jump labels with nothing after them.
8b9a1c
  		 */
8b9a1c
! 		if (!curbuf->b_ind_js && cin_islabel(curbuf->b_ind_maxcomment))
8b9a1c
  		{
8b9a1c
  		    l = after_label(ml_get_curline());
8b9a1c
  		    if (l == NULL || cin_nocode(l))
8b9a1c
--- 7883,7889 ----
8b9a1c
  		/*
8b9a1c
  		 * Ignore jump labels with nothing after them.
8b9a1c
  		 */
8b9a1c
! 		if (!curbuf->b_ind_js && cin_islabel())
8b9a1c
  		{
8b9a1c
  		    l = after_label(ml_get_curline());
8b9a1c
  		    if (l == NULL || cin_nocode(l))
8b9a1c
***************
8b9a1c
*** 7952,7961 ****
8b9a1c
  		    }
8b9a1c
  		    else
8b9a1c
  								     /* XXX */
8b9a1c
! 			amount = get_baseclass_amount(col,
8b9a1c
! 						   curbuf->b_ind_maxparen,
8b9a1c
! 						   curbuf->b_ind_maxcomment,
8b9a1c
! 						   curbuf->b_ind_cpp_baseclass);
8b9a1c
  		    break;
8b9a1c
  		}
8b9a1c
  		else if (lookfor == LOOKFOR_CPP_BASECLASS)
8b9a1c
--- 7929,7935 ----
8b9a1c
  		    }
8b9a1c
  		    else
8b9a1c
  								     /* XXX */
8b9a1c
! 			amount = get_baseclass_amount(col);
8b9a1c
  		    break;
8b9a1c
  		}
8b9a1c
  		else if (lookfor == LOOKFOR_CPP_BASECLASS)
8b9a1c
***************
8b9a1c
*** 7997,8005 ****
8b9a1c
  		     * matching it will take us back to the start of the line.
8b9a1c
  		     */
8b9a1c
  		    (void)find_last_paren(l, '(', ')');
8b9a1c
! 		    trypos = find_match_paren(
8b9a1c
! 				 corr_ind_maxparen(curbuf->b_ind_maxparen,
8b9a1c
! 				      &cur_curpos), curbuf->b_ind_maxcomment);
8b9a1c
  
8b9a1c
  		    /*
8b9a1c
  		     * If we are looking for ',', we also look for matching
8b9a1c
--- 7971,7977 ----
8b9a1c
  		     * matching it will take us back to the start of the line.
8b9a1c
  		     */
8b9a1c
  		    (void)find_last_paren(l, '(', ')');
8b9a1c
! 		    trypos = find_match_paren(corr_ind_maxparen(&cur_curpos));
8b9a1c
  
8b9a1c
  		    /*
8b9a1c
  		     * If we are looking for ',', we also look for matching
8b9a1c
***************
8b9a1c
*** 8007,8013 ****
8b9a1c
  		     */
8b9a1c
  		    if (trypos == NULL && terminated == ','
8b9a1c
  					      && find_last_paren(l, '{', '}'))
8b9a1c
! 			trypos = find_start_brace(curbuf->b_ind_maxcomment);
8b9a1c
  
8b9a1c
  		    if (trypos != NULL)
8b9a1c
  		    {
8b9a1c
--- 7979,7985 ----
8b9a1c
  		     */
8b9a1c
  		    if (trypos == NULL && terminated == ','
8b9a1c
  					      && find_last_paren(l, '{', '}'))
8b9a1c
! 			trypos = find_start_brace();
8b9a1c
  
8b9a1c
  		    if (trypos != NULL)
8b9a1c
  		    {
8b9a1c
***************
8b9a1c
*** 8051,8058 ****
8b9a1c
  		     * ignoring any jump label.	    XXX
8b9a1c
  		     */
8b9a1c
  		    if (!curbuf->b_ind_js)
8b9a1c
! 			cur_amount = skip_label(curwin->w_cursor.lnum,
8b9a1c
! 						&l, curbuf->b_ind_maxcomment);
8b9a1c
  		    else
8b9a1c
  			cur_amount = get_indent();
8b9a1c
  		    /*
8b9a1c
--- 8023,8029 ----
8b9a1c
  		     * ignoring any jump label.	    XXX
8b9a1c
  		     */
8b9a1c
  		    if (!curbuf->b_ind_js)
8b9a1c
! 			cur_amount = skip_label(curwin->w_cursor.lnum, &l);
8b9a1c
  		    else
8b9a1c
  			cur_amount = get_indent();
8b9a1c
  		    /*
8b9a1c
***************
8b9a1c
*** 8162,8172 ****
8b9a1c
  				curwin->w_cursor.col =
8b9a1c
  					  (colnr_T)(l - ml_get_curline()) + 1;
8b9a1c
  
8b9a1c
! 			    if ((trypos = find_start_brace(
8b9a1c
! 					    curbuf->b_ind_maxcomment)) == NULL
8b9a1c
! 				    || find_match(LOOKFOR_IF, trypos->lnum,
8b9a1c
! 					    curbuf->b_ind_maxparen,
8b9a1c
! 					    curbuf->b_ind_maxcomment) == FAIL)
8b9a1c
  				break;
8b9a1c
  			}
8b9a1c
  		    }
8b9a1c
--- 8133,8141 ----
8b9a1c
  				curwin->w_cursor.col =
8b9a1c
  					  (colnr_T)(l - ml_get_curline()) + 1;
8b9a1c
  
8b9a1c
! 			    if ((trypos = find_start_brace()) == NULL
8b9a1c
! 				       || find_match(LOOKFOR_IF, trypos->lnum)
8b9a1c
! 								      == FAIL)
8b9a1c
  				break;
8b9a1c
  			}
8b9a1c
  		    }
8b9a1c
***************
8b9a1c
*** 8261,8268 ****
8b9a1c
  		 * If so: Ignore until the matching "do".
8b9a1c
  		 */
8b9a1c
  							/* XXX */
8b9a1c
! 		else if (cin_iswhileofdo_end(terminated, curbuf->b_ind_maxparen,
8b9a1c
! 						    curbuf->b_ind_maxcomment))
8b9a1c
  		{
8b9a1c
  		    /*
8b9a1c
  		     * Found an unterminated line after a while ();, line up
8b9a1c
--- 8230,8236 ----
8b9a1c
  		 * If so: Ignore until the matching "do".
8b9a1c
  		 */
8b9a1c
  							/* XXX */
8b9a1c
! 		else if (cin_iswhileofdo_end(terminated))
8b9a1c
  		{
8b9a1c
  		    /*
8b9a1c
  		     * Found an unterminated line after a while ();, line up
8b9a1c
***************
8b9a1c
*** 8380,8387 ****
8b9a1c
  			l = ml_get_curline();
8b9a1c
  			if (find_last_paren(l, '(', ')')
8b9a1c
  				&& (trypos = find_match_paren(
8b9a1c
! 					   curbuf->b_ind_maxparen,
8b9a1c
! 					   curbuf->b_ind_maxcomment)) != NULL)
8b9a1c
  			{
8b9a1c
  			    /*
8b9a1c
  			     * Check if we are on a case label now.  This is
8b9a1c
--- 8348,8354 ----
8b9a1c
  			l = ml_get_curline();
8b9a1c
  			if (find_last_paren(l, '(', ')')
8b9a1c
  				&& (trypos = find_match_paren(
8b9a1c
! 					   curbuf->b_ind_maxparen)) != NULL)
8b9a1c
  			{
8b9a1c
  			    /*
8b9a1c
  			     * Check if we are on a case label now.  This is
8b9a1c
***************
8b9a1c
*** 8415,8422 ****
8b9a1c
  			 * Get indent and pointer to text for current line,
8b9a1c
  			 * ignoring any jump label.
8b9a1c
  			 */
8b9a1c
! 			amount = skip_label(curwin->w_cursor.lnum,
8b9a1c
! 						&l, curbuf->b_ind_maxcomment);
8b9a1c
  
8b9a1c
  			if (theline[0] == '{')
8b9a1c
  			    amount += curbuf->b_ind_open_extra;
8b9a1c
--- 8382,8388 ----
8b9a1c
  			 * Get indent and pointer to text for current line,
8b9a1c
  			 * ignoring any jump label.
8b9a1c
  			 */
8b9a1c
! 			amount = skip_label(curwin->w_cursor.lnum, &l);
8b9a1c
  
8b9a1c
  			if (theline[0] == '{')
8b9a1c
  			    amount += curbuf->b_ind_open_extra;
8b9a1c
***************
8b9a1c
*** 8439,8449 ****
8b9a1c
  				&& cin_iselse(l)
8b9a1c
  				&& whilelevel == 0)
8b9a1c
  			{
8b9a1c
! 			    if ((trypos = find_start_brace(
8b9a1c
! 					    curbuf->b_ind_maxcomment)) == NULL
8b9a1c
! 				    || find_match(LOOKFOR_IF, trypos->lnum,
8b9a1c
! 					    curbuf->b_ind_maxparen,
8b9a1c
! 					    curbuf->b_ind_maxcomment) == FAIL)
8b9a1c
  				break;
8b9a1c
  			    continue;
8b9a1c
  			}
8b9a1c
--- 8405,8413 ----
8b9a1c
  				&& cin_iselse(l)
8b9a1c
  				&& whilelevel == 0)
8b9a1c
  			{
8b9a1c
! 			    if ((trypos = find_start_brace()) == NULL
8b9a1c
! 				       || find_match(LOOKFOR_IF, trypos->lnum)
8b9a1c
! 								      == FAIL)
8b9a1c
  				break;
8b9a1c
  			    continue;
8b9a1c
  			}
8b9a1c
***************
8b9a1c
*** 8453,8461 ****
8b9a1c
  			 * that block.
8b9a1c
  			 */
8b9a1c
  			l = ml_get_curline();
8b9a1c
! 			if (find_last_paren(l, '{', '}')
8b9a1c
! 				&& (trypos = find_start_brace(
8b9a1c
! 				 curbuf->b_ind_maxcomment)) != NULL) /* XXX */
8b9a1c
  			{
8b9a1c
  			    curwin->w_cursor = *trypos;
8b9a1c
  			    /* if not "else {" check for terminated again */
8b9a1c
--- 8417,8424 ----
8b9a1c
  			 * that block.
8b9a1c
  			 */
8b9a1c
  			l = ml_get_curline();
8b9a1c
! 			if (find_last_paren(l, '{', '}') /* XXX */
8b9a1c
! 				     && (trypos = find_start_brace()) != NULL)
8b9a1c
  			{
8b9a1c
  			    curwin->w_cursor = *trypos;
8b9a1c
  			    /* if not "else {" check for terminated again */
8b9a1c
***************
8b9a1c
*** 8516,8524 ****
8b9a1c
  		&& !cin_ends_in(theline, (char_u *)":", NULL)
8b9a1c
  		&& !cin_ends_in(theline, (char_u *)",", NULL)
8b9a1c
  		&& cin_isfuncdecl(NULL, cur_curpos.lnum + 1,
8b9a1c
! 				  cur_curpos.lnum + 1,
8b9a1c
! 				  curbuf->b_ind_maxparen,
8b9a1c
! 				  curbuf->b_ind_maxcomment)
8b9a1c
  		&& !cin_isterminated(theline, FALSE, TRUE))
8b9a1c
  	{
8b9a1c
  	    amount = curbuf->b_ind_func_type;
8b9a1c
--- 8479,8485 ----
8b9a1c
  		&& !cin_ends_in(theline, (char_u *)":", NULL)
8b9a1c
  		&& !cin_ends_in(theline, (char_u *)",", NULL)
8b9a1c
  		&& cin_isfuncdecl(NULL, cur_curpos.lnum + 1,
8b9a1c
! 				  cur_curpos.lnum + 1)
8b9a1c
  		&& !cin_isterminated(theline, FALSE, TRUE))
8b9a1c
  	{
8b9a1c
  	    amount = curbuf->b_ind_func_type;
8b9a1c
***************
8b9a1c
*** 8540,8547 ****
8b9a1c
  		/*
8b9a1c
  		 * If we're in a comment now, skip to the start of the comment.
8b9a1c
  		 */						/* XXX */
8b9a1c
! 		if ((trypos = find_start_comment(
8b9a1c
! 					   curbuf->b_ind_maxcomment)) != NULL)
8b9a1c
  		{
8b9a1c
  		    curwin->w_cursor.lnum = trypos->lnum + 1;
8b9a1c
  		    curwin->w_cursor.col = 0;
8b9a1c
--- 8501,8507 ----
8b9a1c
  		/*
8b9a1c
  		 * If we're in a comment now, skip to the start of the comment.
8b9a1c
  		 */						/* XXX */
8b9a1c
! 		if ((trypos = ind_find_start_comment()) != NULL)
8b9a1c
  		{
8b9a1c
  		    curwin->w_cursor.lnum = trypos->lnum + 1;
8b9a1c
  		    curwin->w_cursor.col = 0;
8b9a1c
***************
8b9a1c
*** 8561,8569 ****
8b9a1c
  		if (n)
8b9a1c
  		{
8b9a1c
  								     /* XXX */
8b9a1c
! 		    amount = get_baseclass_amount(col, curbuf->b_ind_maxparen,
8b9a1c
! 					   curbuf->b_ind_maxcomment,
8b9a1c
! 					   curbuf->b_ind_cpp_baseclass);
8b9a1c
  		    break;
8b9a1c
  		}
8b9a1c
  
8b9a1c
--- 8521,8527 ----
8b9a1c
  		if (n)
8b9a1c
  		{
8b9a1c
  								     /* XXX */
8b9a1c
! 		    amount = get_baseclass_amount(col);
8b9a1c
  		    break;
8b9a1c
  		}
8b9a1c
  
8b9a1c
***************
8b9a1c
*** 8595,8602 ****
8b9a1c
  		    /* take us back to opening paren */
8b9a1c
  		    if (find_last_paren(l, '(', ')')
8b9a1c
  			    && (trypos = find_match_paren(
8b9a1c
! 					   curbuf->b_ind_maxparen,
8b9a1c
! 					   curbuf->b_ind_maxcomment)) != NULL)
8b9a1c
  			curwin->w_cursor = *trypos;
8b9a1c
  
8b9a1c
  		    /* For a line ending in ',' that is a continuation line go
8b9a1c
--- 8553,8559 ----
8b9a1c
  		    /* take us back to opening paren */
8b9a1c
  		    if (find_last_paren(l, '(', ')')
8b9a1c
  			    && (trypos = find_match_paren(
8b9a1c
! 					     curbuf->b_ind_maxparen)) != NULL)
8b9a1c
  			curwin->w_cursor = *trypos;
8b9a1c
  
8b9a1c
  		    /* For a line ending in ',' that is a continuation line go
8b9a1c
***************
8b9a1c
*** 8627,8635 ****
8b9a1c
  		 * If the line looks like a function declaration, and we're
8b9a1c
  		 * not in a comment, put it the left margin.
8b9a1c
  		 */
8b9a1c
! 		if (cin_isfuncdecl(NULL, cur_curpos.lnum, 0,
8b9a1c
! 				   curbuf->b_ind_maxparen,
8b9a1c
! 				   curbuf->b_ind_maxcomment))  /* XXX */
8b9a1c
  		    break;
8b9a1c
  		l = ml_get_curline();
8b9a1c
  
8b9a1c
--- 8584,8590 ----
8b9a1c
  		 * If the line looks like a function declaration, and we're
8b9a1c
  		 * not in a comment, put it the left margin.
8b9a1c
  		 */
8b9a1c
! 		if (cin_isfuncdecl(NULL, cur_curpos.lnum, 0))  /* XXX */
8b9a1c
  		    break;
8b9a1c
  		l = ml_get_curline();
8b9a1c
  
8b9a1c
***************
8b9a1c
*** 8677,8685 ****
8b9a1c
  		 * line (and the ones that follow) needs to be indented as
8b9a1c
  		 * parameters.
8b9a1c
  		 */
8b9a1c
! 		if (cin_isfuncdecl(&l, curwin->w_cursor.lnum, 0,
8b9a1c
! 				   curbuf->b_ind_maxparen,
8b9a1c
! 				   curbuf->b_ind_maxcomment))
8b9a1c
  		{
8b9a1c
  		    amount = curbuf->b_ind_param;
8b9a1c
  		    break;
8b9a1c
--- 8632,8638 ----
8b9a1c
  		 * line (and the ones that follow) needs to be indented as
8b9a1c
  		 * parameters.
8b9a1c
  		 */
8b9a1c
! 		if (cin_isfuncdecl(&l, curwin->w_cursor.lnum, 0))
8b9a1c
  		{
8b9a1c
  		    amount = curbuf->b_ind_param;
8b9a1c
  		    break;
8b9a1c
***************
8b9a1c
*** 8710,8717 ****
8b9a1c
  		 */
8b9a1c
  		find_last_paren(l, '(', ')');
8b9a1c
  
8b9a1c
! 		if ((trypos = find_match_paren(curbuf->b_ind_maxparen,
8b9a1c
! 					   curbuf->b_ind_maxcomment)) != NULL)
8b9a1c
  		    curwin->w_cursor = *trypos;
8b9a1c
  		amount = get_indent();	    /* XXX */
8b9a1c
  		break;
8b9a1c
--- 8663,8669 ----
8b9a1c
  		 */
8b9a1c
  		find_last_paren(l, '(', ')');
8b9a1c
  
8b9a1c
! 		if ((trypos = find_match_paren(curbuf->b_ind_maxparen)) != NULL)
8b9a1c
  		    curwin->w_cursor = *trypos;
8b9a1c
  		amount = get_indent();	    /* XXX */
8b9a1c
  		break;
8b9a1c
***************
8b9a1c
*** 8754,8764 ****
8b9a1c
  }
8b9a1c
  
8b9a1c
      static int
8b9a1c
! find_match(lookfor, ourscope, ind_maxparen, ind_maxcomment)
8b9a1c
      int		lookfor;
8b9a1c
      linenr_T	ourscope;
8b9a1c
-     int		ind_maxparen;
8b9a1c
-     int		ind_maxcomment;
8b9a1c
  {
8b9a1c
      char_u	*look;
8b9a1c
      pos_T	*theirscope;
8b9a1c
--- 8706,8714 ----
8b9a1c
  }
8b9a1c
  
8b9a1c
      static int
8b9a1c
! find_match(lookfor, ourscope)
8b9a1c
      int		lookfor;
8b9a1c
      linenr_T	ourscope;
8b9a1c
  {
8b9a1c
      char_u	*look;
8b9a1c
      pos_T	*theirscope;
8b9a1c
***************
8b9a1c
*** 8788,8800 ****
8b9a1c
  	if (cin_iselse(look)
8b9a1c
  		|| cin_isif(look)
8b9a1c
  		|| cin_isdo(look)			    /* XXX */
8b9a1c
! 		|| cin_iswhileofdo(look, curwin->w_cursor.lnum, ind_maxparen))
8b9a1c
  	{
8b9a1c
  	    /*
8b9a1c
  	     * if we've gone outside the braces entirely,
8b9a1c
  	     * we must be out of scope...
8b9a1c
  	     */
8b9a1c
! 	    theirscope = find_start_brace(ind_maxcomment);  /* XXX */
8b9a1c
  	    if (theirscope == NULL)
8b9a1c
  		break;
8b9a1c
  
8b9a1c
--- 8738,8750 ----
8b9a1c
  	if (cin_iselse(look)
8b9a1c
  		|| cin_isif(look)
8b9a1c
  		|| cin_isdo(look)			    /* XXX */
8b9a1c
! 		|| cin_iswhileofdo(look, curwin->w_cursor.lnum))
8b9a1c
  	{
8b9a1c
  	    /*
8b9a1c
  	     * if we've gone outside the braces entirely,
8b9a1c
  	     * we must be out of scope...
8b9a1c
  	     */
8b9a1c
! 	    theirscope = find_start_brace();  /* XXX */
8b9a1c
  	    if (theirscope == NULL)
8b9a1c
  		break;
8b9a1c
  
8b9a1c
***************
8b9a1c
*** 8832,8838 ****
8b9a1c
  	     * if it was a "while" then we need to go back to
8b9a1c
  	     * another "do", so increment whilelevel.  XXX
8b9a1c
  	     */
8b9a1c
! 	    if (cin_iswhileofdo(look, curwin->w_cursor.lnum, ind_maxparen))
8b9a1c
  	    {
8b9a1c
  		++whilelevel;
8b9a1c
  		continue;
8b9a1c
--- 8782,8788 ----
8b9a1c
  	     * if it was a "while" then we need to go back to
8b9a1c
  	     * another "do", so increment whilelevel.  XXX
8b9a1c
  	     */
8b9a1c
! 	    if (cin_iswhileofdo(look, curwin->w_cursor.lnum))
8b9a1c
  	    {
8b9a1c
  		++whilelevel;
8b9a1c
  		continue;
8b9a1c
*** ../vim-7.4.070/src/proto/misc1.pro	2013-11-05 07:12:59.000000000 +0100
8b9a1c
--- src/proto/misc1.pro	2013-11-06 03:19:45.000000000 +0100
8b9a1c
***************
8b9a1c
*** 81,87 ****
8b9a1c
  char_u *FullName_save __ARGS((char_u *fname, int force));
8b9a1c
  pos_T *find_start_comment __ARGS((int ind_maxcomment));
8b9a1c
  void do_c_expr_indent __ARGS((void));
8b9a1c
! int cin_islabel __ARGS((int ind_maxcomment));
8b9a1c
  int cin_iscase __ARGS((char_u *s, int strict));
8b9a1c
  int cin_isscopedecl __ARGS((char_u *s));
8b9a1c
  void parse_cino __ARGS((buf_T *buf));
8b9a1c
--- 81,87 ----
8b9a1c
  char_u *FullName_save __ARGS((char_u *fname, int force));
8b9a1c
  pos_T *find_start_comment __ARGS((int ind_maxcomment));
8b9a1c
  void do_c_expr_indent __ARGS((void));
8b9a1c
! int cin_islabel __ARGS((void));
8b9a1c
  int cin_iscase __ARGS((char_u *s, int strict));
8b9a1c
  int cin_isscopedecl __ARGS((char_u *s));
8b9a1c
  void parse_cino __ARGS((buf_T *buf));
8b9a1c
*** ../vim-7.4.070/src/version.c	2013-11-05 17:40:47.000000000 +0100
8b9a1c
--- src/version.c	2013-11-06 03:43:44.000000000 +0100
8b9a1c
***************
8b9a1c
*** 740,741 ****
8b9a1c
--- 740,743 ----
8b9a1c
  {   /* Add new patch number below this line */
8b9a1c
+ /**/
8b9a1c
+     71,
8b9a1c
  /**/
8b9a1c
8b9a1c
-- 
8b9a1c
A law to reduce crime states: "It is mandatory for a motorist with criminal
8b9a1c
intentions to stop at the city limits and telephone the chief of police as he
8b9a1c
is entering the town.
8b9a1c
		[real standing law in Washington, United States of America]
8b9a1c
8b9a1c
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
8b9a1c
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
8b9a1c
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
8b9a1c
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///