lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
8143bfa
To: vim_dev@googlegroups.com
8143bfa
Subject: Patch 7.3.202
8143bfa
Fcc: outbox
8143bfa
From: Bram Moolenaar <Bram@moolenaar.net>
8143bfa
Mime-Version: 1.0
8143bfa
Content-Type: text/plain; charset=UTF-8
8143bfa
Content-Transfer-Encoding: 8bit
8143bfa
------------
8143bfa
8143bfa
Patch 7.3.202
8143bfa
Problem:    Cannot influence the indent inside a namespace.
8143bfa
Solution:   Add the "N" 'cino' parameter. (Konstantin Lepa)
8143bfa
Files:      runtime/doc/indent.txt, src/misc1.c, src/testdir/test3.in,
8143bfa
            src/testdir/test3.ok
8143bfa
8143bfa
8143bfa
*** ../mercurial/vim73/runtime/doc/indent.txt	2011-04-28 19:01:26.000000000 +0200
8143bfa
--- runtime/doc/indent.txt	2011-05-25 14:35:37.000000000 +0200
8143bfa
***************
8143bfa
*** 128,140 ****
8143bfa
  used CTRL-T or CTRL-D.
8143bfa
  
8143bfa
  						*cinoptions-values*
8143bfa
! The 'cinoptions' option sets how Vim performs indentation.  In the list below,
8143bfa
  "N" represents a number of your choice (the number can be negative).  When
8143bfa
  there is an 's' after the number, Vim multiplies the number by 'shiftwidth':
8143bfa
  "1s" is 'shiftwidth', "2s" is two times 'shiftwidth', etc.  You can use a
8143bfa
! decimal point, too: "-0.5s" is minus half a 'shiftwidth'.  The examples below
8143bfa
! assume a 'shiftwidth' of 4.
8143bfa
! 
8143bfa
  	>N    Amount added for "normal" indent.  Used after a line that should
8143bfa
  	      increase the indent (lines starting with "if", an opening brace,
8143bfa
  	      etc.).  (default 'shiftwidth').
8143bfa
--- 128,147 ----
8143bfa
  used CTRL-T or CTRL-D.
8143bfa
  
8143bfa
  						*cinoptions-values*
8143bfa
! The 'cinoptions' option sets how Vim performs indentation.  The value after
8143bfa
! the option character can be one of these (N is any number):
8143bfa
! 	N	indent N spaces
8143bfa
! 	-N	indent N spaces to the left
8143bfa
! 	Ns	N times 'shiftwidth spaces
8143bfa
! 	-Ns	N times 'shiftwidth spaces to the left
8143bfa
! 
8143bfa
! In the list below,
8143bfa
  "N" represents a number of your choice (the number can be negative).  When
8143bfa
  there is an 's' after the number, Vim multiplies the number by 'shiftwidth':
8143bfa
  "1s" is 'shiftwidth', "2s" is two times 'shiftwidth', etc.  You can use a
8143bfa
! decimal point, too: "-0.5s" is minus half a 'shiftwidth'.
8143bfa
! The examples below assume a 'shiftwidth' of 4.
8143bfa
! 							*cino->*
8143bfa
  	>N    Amount added for "normal" indent.  Used after a line that should
8143bfa
  	      increase the indent (lines starting with "if", an opening brace,
8143bfa
  	      etc.).  (default 'shiftwidth').
8143bfa
***************
8143bfa
*** 145,150 ****
8143bfa
--- 152,158 ----
8143bfa
  		      foo;		foo;			  foo;
8143bfa
  		  }		      }			  }
8143bfa
  <
8143bfa
+ 							*cino-e*
8143bfa
  	eN    Add N to the prevailing indent inside a set of braces if the
8143bfa
  	      opening brace at the End of the line (more precise: is not the
8143bfa
  	      first character in a line).  This is useful if you want a
8143bfa
***************
8143bfa
*** 160,165 ****
8143bfa
--- 168,174 ----
8143bfa
  		      bar;		  bar;		      bar;
8143bfa
  		  }		      }			  }
8143bfa
  <
8143bfa
+ 							*cino-n*
8143bfa
  	nN    Add N to the prevailing indent for a statement after an "if",
8143bfa
  	      "while", etc., if it is NOT inside a set of braces.  This is
8143bfa
  	      useful if you want a different indent when there is no '{'
8143bfa
***************
8143bfa
*** 174,179 ****
8143bfa
--- 183,189 ----
8143bfa
  		      bar;		  bar;		      bar;
8143bfa
  		  }		      }			  }
8143bfa
  <
8143bfa
+ 							*cino-f*
8143bfa
  	fN    Place the first opening brace of a function or other block in
8143bfa
  	      column N.  This applies only for an opening brace that is not
8143bfa
  	      inside other braces and is at the start of the line.  What comes
8143bfa
***************
8143bfa
*** 184,189 ****
8143bfa
--- 194,200 ----
8143bfa
  		  {			{		      {
8143bfa
  		      int foo;		    int foo;		  int foo;
8143bfa
  <
8143bfa
+ 							*cino-{*
8143bfa
  	{N    Place opening braces N characters from the prevailing indent.
8143bfa
  	      This applies only for opening braces that are inside other
8143bfa
  	      braces.  (default 0).
8143bfa
***************
8143bfa
*** 193,198 ****
8143bfa
--- 204,210 ----
8143bfa
  		  {			{		      {
8143bfa
  		      foo;		  foo;		      foo;
8143bfa
  <
8143bfa
+ 							*cino-}*
8143bfa
  	}N    Place closing braces N characters from the matching opening
8143bfa
  	      brace.  (default 0).
8143bfa
  
8143bfa
***************
8143bfa
*** 202,207 ****
8143bfa
--- 214,220 ----
8143bfa
  		      foo;		  foo;		      foo;
8143bfa
  		  }		      }			    }
8143bfa
  <
8143bfa
+ 							*cino-^*
8143bfa
  	^N    Add N to the prevailing indent inside a set of braces if the
8143bfa
  	      opening brace is in column 0.  This can specify a different
8143bfa
  	      indent for whole of a function (some may like to set it to a
8143bfa
***************
8143bfa
*** 216,221 ****
8143bfa
--- 229,235 ----
8143bfa
  		      }			}		  }
8143bfa
  		  }		      }			  }
8143bfa
  <
8143bfa
+ 							*cino-L*
8143bfa
  	LN    Controls placement of jump labels. If N is negative, the label
8143bfa
  	      will be placed at column 1. If N is non-negative, the indent of
8143bfa
  	      the label will be the prevailing indent minus N.  (default -1).
8143bfa
***************
8143bfa
*** 229,234 ****
8143bfa
--- 243,249 ----
8143bfa
  		      }                   }                   }
8143bfa
  		  }                   }                   }
8143bfa
  <
8143bfa
+ 							*cino-:*
8143bfa
  	:N    Place case labels N characters from the indent of the switch().
8143bfa
  	      (default 'shiftwidth').
8143bfa
  
8143bfa
***************
8143bfa
*** 240,245 ****
8143bfa
--- 255,261 ----
8143bfa
  		      default:	      default:
8143bfa
  		  }		      }
8143bfa
  <
8143bfa
+ 							*cino-=*
8143bfa
  	=N    Place statements occurring after a case label N characters from
8143bfa
  	      the indent of the label.  (default 'shiftwidth').
8143bfa
  
8143bfa
***************
8143bfa
*** 247,252 ****
8143bfa
--- 263,269 ----
8143bfa
  		   case 11:		case 11:  a = a + 1;
8143bfa
  		       a = a + 1;		  b = b + 1;
8143bfa
  <
8143bfa
+ 							*cino-l*
8143bfa
  	lN    If N != 0 Vim will align with a case label instead of the
8143bfa
  	      statement after it in the same line.
8143bfa
  
8143bfa
***************
8143bfa
*** 272,277 ****
8143bfa
--- 290,296 ----
8143bfa
  			  break;	  break;
8143bfa
  		  }		      }
8143bfa
  <
8143bfa
+ 							*cino-g*
8143bfa
  	gN    Place C++ scope declarations N characters from the indent of the
8143bfa
  	      block they are in.  (default 'shiftwidth').  A scope declaration
8143bfa
  	      can be "public:", "protected:" or "private:".
8143bfa
***************
8143bfa
*** 283,288 ****
8143bfa
--- 302,308 ----
8143bfa
  		      private:	      private:
8143bfa
  		  }		      }
8143bfa
  <
8143bfa
+ 							*cino-h*
8143bfa
  	hN    Place statements occurring after a C++ scope declaration N
8143bfa
  	      characters from the indent of the label.  (default
8143bfa
  	      'shiftwidth').
8143bfa
***************
8143bfa
*** 291,296 ****
8143bfa
--- 311,331 ----
8143bfa
  		   public:		public:   a = a + 1;
8143bfa
  		       a = a + 1;		  b = b + 1;
8143bfa
  <
8143bfa
+ 							*cino-N*
8143bfa
+ 	NN    Indent inside C++ namespace N characters extra compared to a
8143bfa
+ 	      normal block.  (default 0).
8143bfa
+ 
8143bfa
+ 		cino=			   cino=N-s >
8143bfa
+ 		  namespace {                namespace {
8143bfa
+ 		      void function();       void function();
8143bfa
+ 		  }                          }
8143bfa
+ 
8143bfa
+ 		  namespace my               namespace my
8143bfa
+ 		  {                          {
8143bfa
+ 		      void function();       void function();
8143bfa
+ 		  }                          }
8143bfa
+ <
8143bfa
+ 							*cino-p*
8143bfa
  	pN    Parameter declarations for K&R-style function declarations will
8143bfa
  	      be indented N characters from the margin.  (default
8143bfa
  	      'shiftwidth').
8143bfa
***************
8143bfa
*** 300,305 ****
8143bfa
--- 335,341 ----
8143bfa
  		      int a;	      int a;			  int a;
8143bfa
  		      char b;	      char b;			  char b;
8143bfa
  <
8143bfa
+ 							*cino-t*
8143bfa
  	tN    Indent a function return type declaration N characters from the
8143bfa
  	      margin.  (default 'shiftwidth').
8143bfa
  
8143bfa
***************
8143bfa
*** 307,312 ****
8143bfa
--- 343,349 ----
8143bfa
  		      int	      int			 int
8143bfa
  		  func()	      func()		  func()
8143bfa
  <
8143bfa
+ 							*cino-i*
8143bfa
  	iN    Indent C++ base class declarations and constructor
8143bfa
  	      initializations, if they start in a new line (otherwise they
8143bfa
  	      are aligned at the right side of the ':').
8143bfa
***************
8143bfa
*** 330,335 ****
8143bfa
--- 368,374 ----
8143bfa
  		  a = b + 9 *		    a = b + 9 *
8143bfa
  		      c;			      c;
8143bfa
  <
8143bfa
+ 							*cino-c*
8143bfa
  	cN    Indent comment lines after the comment opener, when there is no
8143bfa
  	      other text with which to align, N characters from the comment
8143bfa
  	      opener.  (default 3).  See also |format-comments|.
8143bfa
***************
8143bfa
*** 339,344 ****
8143bfa
--- 378,384 ----
8143bfa
  		     text.			 text.
8143bfa
  		   */			     */
8143bfa
  <
8143bfa
+ 							*cino-C*
8143bfa
  	CN    When N is non-zero, indent comment lines by the amount specified
8143bfa
  	      with the c flag above even if there is other text behind the
8143bfa
  	      comment opener.  (default 0).
8143bfa
***************
8143bfa
*** 349,360 ****
8143bfa
--- 389,402 ----
8143bfa
  		  ********/		    ********/
8143bfa
  <	      (Example uses ":set comments& comments-=s1:/* comments^=s0:/*")
8143bfa
  
8143bfa
+ 							*cino-/*
8143bfa
  	/N    Indent comment lines N characters extra.  (default 0).
8143bfa
  		cino=			  cino=/4 >
8143bfa
  		  a = b;		    a = b;
8143bfa
  		  /* comment */			/* comment */
8143bfa
  		  c = d;		    c = d;
8143bfa
  <
8143bfa
+ 							*cino-(*
8143bfa
  	(N    When in unclosed parentheses, indent N characters from the line
8143bfa
  	      with the unclosed parentheses.  Add a 'shiftwidth' for every
8143bfa
  	      unclosed parentheses.  When N is 0 or the unclosed parentheses
8143bfa
***************
8143bfa
*** 370,375 ****
8143bfa
--- 412,418 ----
8143bfa
  			  (c2 || c3))		(c2 || c3))
8143bfa
  		     {			       {
8143bfa
  <
8143bfa
+ 							*cino-u*
8143bfa
  	uN    Same as (N, but for one level deeper.  (default 'shiftwidth').
8143bfa
  
8143bfa
  		cino=			  cino=u2 >
8143bfa
***************
8143bfa
*** 377,382 ****
8143bfa
--- 420,426 ----
8143bfa
  			  && (c22345		    && (c22345
8143bfa
  			      || c3))		      || c3))
8143bfa
  <
8143bfa
+ 							*cino-U*
8143bfa
  	UN    When N is non-zero, do not ignore the indenting specified by
8143bfa
  	      ( or u in case that the unclosed parentheses is the first
8143bfa
  	      non-white character in its line.  (default 0).
8143bfa
***************
8143bfa
*** 388,393 ****
8143bfa
--- 432,438 ----
8143bfa
  		       c3			    c3
8143bfa
  		      ) && c4;			) && c4;
8143bfa
  <
8143bfa
+ 							*cino-2*
8143bfa
  	wN    When in unclosed parentheses and N is non-zero and either
8143bfa
  	      using "(0" or "u0", respectively, or using "U0" and the unclosed
8143bfa
  	      parentheses is the first non-white character in its line, line
8143bfa
***************
8143bfa
*** 400,405 ****
8143bfa
--- 445,451 ----
8143bfa
  				|| c3))		    || c3))
8143bfa
  		      foo;			foo;
8143bfa
  <
8143bfa
+ 							*cino-W*
8143bfa
  	WN    When in unclosed parentheses and N is non-zero and either
8143bfa
  	      using "(0" or "u0", respectively and the unclosed parentheses is
8143bfa
  	      the last non-white character in its line and it is not the
8143bfa
***************
8143bfa
*** 414,419 ****
8143bfa
--- 460,466 ----
8143bfa
  		  a_short_line(argument,    a_short_line(argument,
8143bfa
  			       argument);		 argument);
8143bfa
  <
8143bfa
+ 							*cino-m*
8143bfa
  	mN    When N is non-zero, line up a line starting with a closing
8143bfa
  	      parentheses with the first character of the line with the
8143bfa
  	      matching opening parentheses.  (default 0).
8143bfa
***************
8143bfa
*** 428,433 ****
8143bfa
--- 475,481 ----
8143bfa
  		     )			    )
8143bfa
  		      foo;			foo;
8143bfa
  <
8143bfa
+ 							*cino-M*
8143bfa
  	MN    When N is non-zero, line up a line starting with a closing
8143bfa
  	      parentheses with the first character of the previous line.
8143bfa
  	      (default 0).
8143bfa
***************
8143bfa
*** 437,443 ****
8143bfa
  			 cond2			   cond2
8143bfa
  		     )				   )
8143bfa
  <
8143bfa
! 					*java-cinoptions* *java-indenting*
8143bfa
  	jN    Indent java anonymous classes correctly.  The value 'N' is
8143bfa
  	      currently unused but must be non-zero (e.g. 'j1').  'j1' will
8143bfa
  	      indent for example the following code snippet correctly: >
8143bfa
--- 485,491 ----
8143bfa
  			 cond2			   cond2
8143bfa
  		     )				   )
8143bfa
  <
8143bfa
! 				*java-cinoptions* *java-indenting* *cino-j*
8143bfa
  	jN    Indent java anonymous classes correctly.  The value 'N' is
8143bfa
  	      currently unused but must be non-zero (e.g. 'j1').  'j1' will
8143bfa
  	      indent for example the following code snippet correctly: >
8143bfa
***************
8143bfa
*** 448,454 ****
8143bfa
  		    }
8143bfa
  		});
8143bfa
  <
8143bfa
! 				*javascript-cinoptions* *javascript-indenting*
8143bfa
  	JN    Indent JavaScript object declarations correctly by not confusing
8143bfa
  	      them with labels.  The value 'N' is currently unused but must be 
8143bfa
  	      non-zero (e.g. 'J1'). >
8143bfa
--- 496,502 ----
8143bfa
  		    }
8143bfa
  		});
8143bfa
  <
8143bfa
! 			*javascript-cinoptions* *javascript-indenting* *cino-J*
8143bfa
  	JN    Indent JavaScript object declarations correctly by not confusing
8143bfa
  	      them with labels.  The value 'N' is currently unused but must be 
8143bfa
  	      non-zero (e.g. 'J1'). >
8143bfa
***************
8143bfa
*** 483,489 ****
8143bfa
  
8143bfa
  
8143bfa
  The defaults, spelled out in full, are:
8143bfa
! 	cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:s,=s,l0,b0,gs,hs,ps,ts,is,+s,
8143bfa
  			c3,C0,/0,(2s,us,U0,w0,W0,m0,j0,J0,)20,*70,#0
8143bfa
  
8143bfa
  Vim puts a line in column 1 if:
8143bfa
--- 534,540 ----
8143bfa
  
8143bfa
  
8143bfa
  The defaults, spelled out in full, are:
8143bfa
! 	cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:s,=s,l0,b0,gs,hs,N0,ps,ts,is,+s,
8143bfa
  			c3,C0,/0,(2s,us,U0,w0,W0,m0,j0,J0,)20,*70,#0
8143bfa
  
8143bfa
  Vim puts a line in column 1 if:
8143bfa
*** ../mercurial/vim73/src/misc1.c	2011-05-25 13:33:59.000000000 +0200
8143bfa
--- src/misc1.c	2011-05-25 14:57:31.000000000 +0200
8143bfa
***************
8143bfa
*** 4959,4964 ****
8143bfa
--- 4959,4965 ----
8143bfa
  static int	corr_ind_maxparen __ARGS((int ind_maxparen, pos_T *startpos));
8143bfa
  static int	find_last_paren __ARGS((char_u *l, int start, int end));
8143bfa
  static int	find_match __ARGS((int lookfor, linenr_T ourscope, int ind_maxparen, int ind_maxcomment));
8143bfa
+ static int	cin_is_cpp_namespace __ARGS((char_u *));
8143bfa
  
8143bfa
  static int	ind_hash_comment = 0;   /* # starts a comment */
8143bfa
  
8143bfa
***************
8143bfa
*** 5221,5226 ****
8143bfa
--- 5222,5271 ----
8143bfa
      return (*(s = cin_skipcomment(s + i)) == ':' && s[1] != ':');
8143bfa
  }
8143bfa
  
8143bfa
+ /* Maximum number of lines to search back for a "namespace" line. */
8143bfa
+ #define FIND_NAMESPACE_LIM 20
8143bfa
+ 
8143bfa
+ /*
8143bfa
+  * Recognize a "namespace" scope declaration.
8143bfa
+  */
8143bfa
+     static int
8143bfa
+ cin_is_cpp_namespace(s)
8143bfa
+     char_u	*s;
8143bfa
+ {
8143bfa
+     char_u	*p;
8143bfa
+     int		has_name = FALSE;
8143bfa
+ 
8143bfa
+     s = cin_skipcomment(s);
8143bfa
+     if (STRNCMP(s, "namespace", 9) == 0 && (s[9] == NUL || !vim_iswordc(s[9])))
8143bfa
+     {
8143bfa
+ 	p = cin_skipcomment(skipwhite(s + 9));
8143bfa
+ 	while (*p != NUL)
8143bfa
+ 	{
8143bfa
+ 	    if (vim_iswhite(*p))
8143bfa
+ 	    {
8143bfa
+ 		has_name = TRUE; /* found end of a name */
8143bfa
+ 		p = cin_skipcomment(skipwhite(p));
8143bfa
+ 	    }
8143bfa
+ 	    else if (*p == '{')
8143bfa
+ 	    {
8143bfa
+ 		break;
8143bfa
+ 	    }
8143bfa
+ 	    else if (vim_iswordc(*p))
8143bfa
+ 	    {
8143bfa
+ 		if (has_name)
8143bfa
+ 		    return FALSE; /* word character after skipping past name */
8143bfa
+ 		++p;
8143bfa
+ 	    }
8143bfa
+ 	    else
8143bfa
+ 	    {
8143bfa
+ 		return FALSE;
8143bfa
+ 	    }
8143bfa
+ 	}
8143bfa
+ 	return TRUE;
8143bfa
+     }
8143bfa
+     return FALSE;
8143bfa
+ }
8143bfa
+ 
8143bfa
  /*
8143bfa
   * Return a pointer to the first non-empty non-comment character after a ':'.
8143bfa
   * Return NULL if not found.
8143bfa
***************
8143bfa
*** 6296,6301 ****
8143bfa
--- 6341,6351 ----
8143bfa
       */
8143bfa
      int ind_keep_case_label = 0;
8143bfa
  
8143bfa
+     /*
8143bfa
+      * handle C++ namespace
8143bfa
+      */
8143bfa
+     int ind_cpp_namespace = 0;
8143bfa
+ 
8143bfa
      pos_T	cur_curpos;
8143bfa
      int		amount;
8143bfa
      int		scope_amount;
8143bfa
***************
8143bfa
*** 6336,6341 ****
8143bfa
--- 6386,6392 ----
8143bfa
      int		n;
8143bfa
      int		iscase;
8143bfa
      int		lookfor_break;
8143bfa
+     int		lookfor_cpp_namespace = FALSE;
8143bfa
      int		cont_amount = 0;    /* amount for continuation line */
8143bfa
      int		original_line_islabel;
8143bfa
  
8143bfa
***************
8143bfa
*** 6409,6414 ****
8143bfa
--- 6460,6466 ----
8143bfa
  	    case 'J': ind_js = n; break;
8143bfa
  	    case 'l': ind_keep_case_label = n; break;
8143bfa
  	    case '#': ind_hash_comment = n; break;
8143bfa
+ 	    case 'N': ind_cpp_namespace = n; break;
8143bfa
  	}
8143bfa
  	if (*options == ',')
8143bfa
  	    ++options;
8143bfa
***************
8143bfa
*** 6976,6986 ****
8143bfa
--- 7028,7051 ----
8143bfa
  	    if (start_brace == BRACE_IN_COL0)	    /* '{' is in column 0 */
8143bfa
  	    {
8143bfa
  		amount = ind_open_left_imag;
8143bfa
+ 		lookfor_cpp_namespace = TRUE;
8143bfa
+ 	    }
8143bfa
+ 	    else if (start_brace == BRACE_AT_START &&
8143bfa
+ 		    lookfor_cpp_namespace)	  /* '{' is at start */
8143bfa
+ 	    {
8143bfa
+ 
8143bfa
+ 		lookfor_cpp_namespace = TRUE;
8143bfa
  	    }
8143bfa
  	    else
8143bfa
  	    {
8143bfa
  		if (start_brace == BRACE_AT_END)    /* '{' is at end of line */
8143bfa
+ 		{
8143bfa
  		    amount += ind_open_imag;
8143bfa
+ 
8143bfa
+ 		    l = skipwhite(ml_get_curline());
8143bfa
+ 		    if (cin_is_cpp_namespace(l))
8143bfa
+ 			amount += ind_cpp_namespace;
8143bfa
+ 		}
8143bfa
  		else
8143bfa
  		{
8143bfa
  		    /* Compensate for adding ind_open_extra later. */
8143bfa
***************
8143bfa
*** 7151,7156 ****
8143bfa
--- 7216,7261 ----
8143bfa
  			else
8143bfa
  			    amount += ind_continuation;
8143bfa
  		    }
8143bfa
+ 		    else if (lookfor_cpp_namespace)
8143bfa
+ 		    {
8143bfa
+ 			if (curwin->w_cursor.lnum == ourscope)
8143bfa
+ 			    continue;
8143bfa
+ 
8143bfa
+ 			if (curwin->w_cursor.lnum == 0
8143bfa
+ 				|| curwin->w_cursor.lnum
8143bfa
+ 					      < ourscope - FIND_NAMESPACE_LIM)
8143bfa
+ 			    break;
8143bfa
+ 
8143bfa
+ 			l = ml_get_curline();
8143bfa
+ 
8143bfa
+ 			/*
8143bfa
+ 			 * If we're in a comment now, skip to the start of the
8143bfa
+ 			 * comment.
8143bfa
+ 			 */
8143bfa
+ 			trypos = find_start_comment(ind_maxcomment);
8143bfa
+ 			if (trypos != NULL)
8143bfa
+ 			{
8143bfa
+ 			    curwin->w_cursor.lnum = trypos->lnum + 1;
8143bfa
+ 			    curwin->w_cursor.col = 0;
8143bfa
+ 			    continue;
8143bfa
+ 			}
8143bfa
+ 
8143bfa
+ 			/*
8143bfa
+ 			 * Skip preprocessor directives and blank lines.
8143bfa
+ 			 */
8143bfa
+ 			if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
8143bfa
+ 			    continue;
8143bfa
+ 
8143bfa
+ 			if (cin_is_cpp_namespace(l))
8143bfa
+ 			{
8143bfa
+ 			    amount += ind_cpp_namespace;
8143bfa
+ 			    break;
8143bfa
+ 			}
8143bfa
+ 
8143bfa
+ 			if (cin_nocode(l))
8143bfa
+ 			    continue;
8143bfa
+ 
8143bfa
+ 		    }
8143bfa
  		    else if (lookfor != LOOKFOR_TERM
8143bfa
  					  && lookfor != LOOKFOR_CPP_BASECLASS)
8143bfa
  		    {
8143bfa
*** ../mercurial/vim73/src/testdir/test3.in	2011-05-25 13:33:59.000000000 +0200
8143bfa
--- src/testdir/test3.in	2011-05-25 14:47:31.000000000 +0200
8143bfa
***************
8143bfa
*** 799,804 ****
8143bfa
--- 799,867 ----
8143bfa
  	df */
8143bfa
  		hello
8143bfa
  }
8143bfa
+ 
8143bfa
+ /* valid namespaces with normal indent */
8143bfa
+ namespace
8143bfa
+ {
8143bfa
+ {
8143bfa
+   111111111111;
8143bfa
+ }
8143bfa
+ }
8143bfa
+ namespace /* test */
8143bfa
+ {
8143bfa
+   11111111111111111;
8143bfa
+ }
8143bfa
+ namespace // test
8143bfa
+ {
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ namespace
8143bfa
+ {
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test
8143bfa
+ {
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ namespace{
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test{
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ namespace {
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test {
8143bfa
+   111111111111111111;
8143bfa
+ namespace test2 {
8143bfa
+   22222222222222222;
8143bfa
+ }
8143bfa
+ }
8143bfa
+ 
8143bfa
+ /* invalid namespaces use block indent */
8143bfa
+ namespace test test2 {
8143bfa
+   111111111111111111111;
8143bfa
+ }
8143bfa
+ namespace11111111111 {
8143bfa
+   111111111111;
8143bfa
+ }
8143bfa
+ namespace() {
8143bfa
+   1111111111111;
8143bfa
+ }
8143bfa
+ namespace()
8143bfa
+ {
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test test2
8143bfa
+ {
8143bfa
+   1111111111111111111;
8143bfa
+ }
8143bfa
+ namespace111111111
8143bfa
+ {
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ 
8143bfa
  /* end of AUTO */
8143bfa
  
8143bfa
  STARTTEST
8143bfa
***************
8143bfa
*** 1428,1433 ****
8143bfa
--- 1491,1566 ----
8143bfa
  }
8143bfa
  
8143bfa
  STARTTEST
8143bfa
+ :set cino=N-s
8143bfa
+ /namespaces
8143bfa
+ =/^NAMESPACEEND
8143bfa
+ ENDTEST
8143bfa
+ 
8143bfa
+ /* valid namespaces with normal indent */
8143bfa
+ namespace
8143bfa
+ {
8143bfa
+    {
8143bfa
+ 	111111111111;
8143bfa
+ }
8143bfa
+ }
8143bfa
+ namespace /* test */
8143bfa
+ {
8143bfa
+   11111111111111111;
8143bfa
+ }
8143bfa
+ namespace // test
8143bfa
+ {
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ namespace
8143bfa
+ {
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test
8143bfa
+ {
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ namespace{
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test{
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ namespace {
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test {
8143bfa
+   111111111111111111;
8143bfa
+ namespace test2 {
8143bfa
+   22222222222222222;
8143bfa
+ }
8143bfa
+ }
8143bfa
+ 
8143bfa
+ /* invalid namespaces use block indent */
8143bfa
+ namespace test test2 {
8143bfa
+   111111111111111111111;
8143bfa
+ }
8143bfa
+ namespace11111111111 {
8143bfa
+   111111111111;
8143bfa
+ }
8143bfa
+ namespace() {
8143bfa
+   1111111111111;
8143bfa
+ }
8143bfa
+ namespace()
8143bfa
+ {
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test test2
8143bfa
+ {
8143bfa
+   1111111111111111111;
8143bfa
+ }
8143bfa
+ namespace111111111
8143bfa
+ {
8143bfa
+   111111111111111111;
8143bfa
+ }
8143bfa
+ NAMESPACEEND
8143bfa
+ 
8143bfa
+ 
8143bfa
+ STARTTEST
8143bfa
  :g/^STARTTEST/.,/^ENDTEST/d
8143bfa
  :1;/start of AUTO/,$wq! test.out
8143bfa
  ENDTEST
8143bfa
*** ../mercurial/vim73/src/testdir/test3.ok	2011-05-25 13:33:59.000000000 +0200
8143bfa
--- src/testdir/test3.ok	2011-05-25 14:48:02.000000000 +0200
8143bfa
***************
8143bfa
*** 787,792 ****
8143bfa
--- 787,855 ----
8143bfa
  	   df */
8143bfa
  	hello
8143bfa
  }
8143bfa
+ 
8143bfa
+ /* valid namespaces with normal indent */
8143bfa
+ namespace
8143bfa
+ {
8143bfa
+ 	{
8143bfa
+ 		111111111111;
8143bfa
+ 	}
8143bfa
+ }
8143bfa
+ namespace /* test */
8143bfa
+ {
8143bfa
+ 	11111111111111111;
8143bfa
+ }
8143bfa
+ namespace // test
8143bfa
+ {
8143bfa
+ 	111111111111111111;
8143bfa
+ }
8143bfa
+ namespace
8143bfa
+ {
8143bfa
+ 	111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test
8143bfa
+ {
8143bfa
+ 	111111111111111111;
8143bfa
+ }
8143bfa
+ namespace{
8143bfa
+ 	111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test{
8143bfa
+ 	111111111111111111;
8143bfa
+ }
8143bfa
+ namespace {
8143bfa
+ 	111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test {
8143bfa
+ 	111111111111111111;
8143bfa
+ 	namespace test2 {
8143bfa
+ 		22222222222222222;
8143bfa
+ 	}
8143bfa
+ }
8143bfa
+ 
8143bfa
+ /* invalid namespaces use block indent */
8143bfa
+ namespace test test2 {
8143bfa
+ 	111111111111111111111;
8143bfa
+ }
8143bfa
+ namespace11111111111 {
8143bfa
+ 	111111111111;
8143bfa
+ }
8143bfa
+ namespace() {
8143bfa
+ 	1111111111111;
8143bfa
+ }
8143bfa
+ namespace()
8143bfa
+ {
8143bfa
+ 	111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test test2
8143bfa
+ {
8143bfa
+ 	1111111111111111111;
8143bfa
+ }
8143bfa
+ namespace111111111
8143bfa
+ {
8143bfa
+ 	111111111111111111;
8143bfa
+ }
8143bfa
+ 
8143bfa
  /* end of AUTO */
8143bfa
  
8143bfa
  
8143bfa
***************
8143bfa
*** 1273,1275 ****
8143bfa
--- 1336,1403 ----
8143bfa
  	baz();
8143bfa
  }
8143bfa
  
8143bfa
+ 
8143bfa
+ /* valid namespaces with normal indent */
8143bfa
+ namespace
8143bfa
+ {
8143bfa
+ {
8143bfa
+ 	111111111111;
8143bfa
+ }
8143bfa
+ }
8143bfa
+ namespace /* test */
8143bfa
+ {
8143bfa
+ 11111111111111111;
8143bfa
+ }
8143bfa
+ namespace // test
8143bfa
+ {
8143bfa
+ 111111111111111111;
8143bfa
+ }
8143bfa
+ namespace
8143bfa
+ {
8143bfa
+ 111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test
8143bfa
+ {
8143bfa
+ 111111111111111111;
8143bfa
+ }
8143bfa
+ namespace{
8143bfa
+ 111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test{
8143bfa
+ 111111111111111111;
8143bfa
+ }
8143bfa
+ namespace {
8143bfa
+ 111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test {
8143bfa
+ 111111111111111111;
8143bfa
+ namespace test2 {
8143bfa
+ 22222222222222222;
8143bfa
+ }
8143bfa
+ }
8143bfa
+ 
8143bfa
+ /* invalid namespaces use block indent */
8143bfa
+ namespace test test2 {
8143bfa
+ 	111111111111111111111;
8143bfa
+ }
8143bfa
+ namespace11111111111 {
8143bfa
+ 	111111111111;
8143bfa
+ }
8143bfa
+ namespace() {
8143bfa
+ 	1111111111111;
8143bfa
+ }
8143bfa
+ namespace()
8143bfa
+ {
8143bfa
+ 	111111111111111111;
8143bfa
+ }
8143bfa
+ namespace test test2
8143bfa
+ {
8143bfa
+ 	1111111111111111111;
8143bfa
+ }
8143bfa
+ namespace111111111
8143bfa
+ {
8143bfa
+ 	111111111111111111;
8143bfa
+ }
8143bfa
+ NAMESPACEEND
8143bfa
+ 
8143bfa
+ 
8143bfa
*** ../vim-7.3.201/src/version.c	2011-05-25 13:33:59.000000000 +0200
8143bfa
--- src/version.c	2011-05-25 15:14:20.000000000 +0200
8143bfa
***************
8143bfa
*** 711,712 ****
8143bfa
--- 711,714 ----
8143bfa
  {   /* Add new patch number below this line */
8143bfa
+ /**/
8143bfa
+     202,
8143bfa
  /**/
8143bfa
8143bfa
-- 
8143bfa
hundred-and-one symptoms of being an internet addict:
8143bfa
107. When using your phone you forget that you don't have to use your
8143bfa
     keyboard.
8143bfa
8143bfa
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
8143bfa
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
8143bfa
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
8143bfa
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///