Karsten Hopp 227f63
To: vim-dev@vim.org
Karsten Hopp 227f63
Subject: Patch 7.2.378
Karsten Hopp 227f63
Fcc: outbox
Karsten Hopp 227f63
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 227f63
Mime-Version: 1.0
Karsten Hopp 227f63
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 227f63
Content-Transfer-Encoding: 8bit
Karsten Hopp 227f63
------------
Karsten Hopp 227f63
Karsten Hopp 227f63
Patch 7.2.378
Karsten Hopp 227f63
Problem:    C function declaration indented too much. (Rui)
Karsten Hopp 227f63
Solution:   Don't see a line containing { or } as a type. (Matt Wozniski)
Karsten Hopp 227f63
Files:	    src/misc1.c
Karsten Hopp 227f63
Karsten Hopp 227f63
Karsten Hopp 227f63
*** ../vim-7.2.377/src/misc1.c	2010-01-06 17:46:03.000000000 +0100
Karsten Hopp 227f63
--- src/misc1.c	2010-02-26 22:36:50.000000000 +0100
Karsten Hopp 227f63
***************
Karsten Hopp 227f63
*** 7727,7737 ****
Karsten Hopp 227f63
  	/*
Karsten Hopp 227f63
  	 * If the NEXT line is a function declaration, the current
Karsten Hopp 227f63
  	 * line needs to be indented as a function type spec.
Karsten Hopp 227f63
! 	 * Don't do this if the current line looks like a comment
Karsten Hopp 227f63
! 	 * or if the current line is terminated, ie. ends in ';'.
Karsten Hopp 227f63
  	 */
Karsten Hopp 227f63
  	else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count
Karsten Hopp 227f63
  		&& !cin_nocode(theline)
Karsten Hopp 227f63
  		&& !cin_ends_in(theline, (char_u *)":", NULL)
Karsten Hopp 227f63
  		&& !cin_ends_in(theline, (char_u *)",", NULL)
Karsten Hopp 227f63
  		&& cin_isfuncdecl(NULL, cur_curpos.lnum + 1)
Karsten Hopp 227f63
--- 7727,7740 ----
Karsten Hopp 227f63
  	/*
Karsten Hopp 227f63
  	 * If the NEXT line is a function declaration, the current
Karsten Hopp 227f63
  	 * line needs to be indented as a function type spec.
Karsten Hopp 227f63
! 	 * Don't do this if the current line looks like a comment or if the
Karsten Hopp 227f63
! 	 * current line is terminated, ie. ends in ';', or if the current line
Karsten Hopp 227f63
! 	 * contains { or }: "void f() {\n if (1)"
Karsten Hopp 227f63
  	 */
Karsten Hopp 227f63
  	else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count
Karsten Hopp 227f63
  		&& !cin_nocode(theline)
Karsten Hopp 227f63
+ 		&& vim_strchr(theline, '{') == NULL
Karsten Hopp 227f63
+ 		&& vim_strchr(theline, '}') == NULL
Karsten Hopp 227f63
  		&& !cin_ends_in(theline, (char_u *)":", NULL)
Karsten Hopp 227f63
  		&& !cin_ends_in(theline, (char_u *)",", NULL)
Karsten Hopp 227f63
  		&& cin_isfuncdecl(NULL, cur_curpos.lnum + 1)
Karsten Hopp 227f63
*** ../vim-7.2.377/src/version.c	2010-02-26 22:05:17.000000000 +0100
Karsten Hopp 227f63
--- src/version.c	2010-03-02 12:30:30.000000000 +0100
Karsten Hopp 227f63
***************
Karsten Hopp 227f63
*** 683,684 ****
Karsten Hopp 227f63
--- 683,686 ----
Karsten Hopp 227f63
  {   /* Add new patch number below this line */
Karsten Hopp 227f63
+ /**/
Karsten Hopp 227f63
+     378,
Karsten Hopp 227f63
  /**/
Karsten Hopp 227f63
Karsten Hopp 227f63
-- 
Karsten Hopp 227f63
   An extraordinary TALL KNIGHT in all black (possibly John with Mike on his
Karsten Hopp 227f63
   shoulders) walks out from the dark trees.  He is extremely fierce and
Karsten Hopp 227f63
   gruesome countenance.  He walks towards KING ARTHUR and PATSY, who are
Karsten Hopp 227f63
   wazzing like mad.  (Salopian slang, meaning very scared.  almost to the
Karsten Hopp 227f63
   point of wetting oneself, e.g. before an important football match or
Karsten Hopp 227f63
   prior to a postering.  Salopian slang meaning a beating by the school
Karsten Hopp 227f63
   praeposters.  Sorry about the Salopian slant to this stage direction - Ed.)
Karsten Hopp 227f63
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp 227f63
Karsten Hopp 227f63
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 227f63
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 227f63
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 227f63
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///