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