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