Blob Blame History Raw
To: vim-dev@vim.org
Subject: Patch 7.2.378
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.2.378
Problem:    C function declaration indented too much. (Rui)
Solution:   Don't see a line containing { or } as a type. (Matt Wozniski)
Files:	    src/misc1.c


*** ../vim-7.2.377/src/misc1.c	2010-01-06 17:46:03.000000000 +0100
--- src/misc1.c	2010-02-26 22:36:50.000000000 +0100
***************
*** 7727,7737 ****
  	/*
  	 * If the NEXT line is a function declaration, the current
  	 * line needs to be indented as a function type spec.
! 	 * Don't do this if the current line looks like a comment
! 	 * or if the current line is terminated, ie. ends in ';'.
  	 */
  	else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count
  		&& !cin_nocode(theline)
  		&& !cin_ends_in(theline, (char_u *)":", NULL)
  		&& !cin_ends_in(theline, (char_u *)",", NULL)
  		&& cin_isfuncdecl(NULL, cur_curpos.lnum + 1)
--- 7727,7740 ----
  	/*
  	 * If the NEXT line is a function declaration, the current
  	 * line needs to be indented as a function type spec.
! 	 * Don't do this if the current line looks like a comment or if the
! 	 * current line is terminated, ie. ends in ';', or if the current line
! 	 * contains { or }: "void f() {\n if (1)"
  	 */
  	else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count
  		&& !cin_nocode(theline)
+ 		&& vim_strchr(theline, '{') == NULL
+ 		&& vim_strchr(theline, '}') == NULL
  		&& !cin_ends_in(theline, (char_u *)":", NULL)
  		&& !cin_ends_in(theline, (char_u *)",", NULL)
  		&& cin_isfuncdecl(NULL, cur_curpos.lnum + 1)
*** ../vim-7.2.377/src/version.c	2010-02-26 22:05:17.000000000 +0100
--- src/version.c	2010-03-02 12:30:30.000000000 +0100
***************
*** 683,684 ****
--- 683,686 ----
  {   /* Add new patch number below this line */
+ /**/
+     378,
  /**/

-- 
   An extraordinary TALL KNIGHT in all black (possibly John with Mike on his
   shoulders) walks out from the dark trees.  He is extremely fierce and
   gruesome countenance.  He walks towards KING ARTHUR and PATSY, who are
   wazzing like mad.  (Salopian slang, meaning very scared.  almost to the
   point of wetting oneself, e.g. before an important football match or
   prior to a postering.  Salopian slang meaning a beating by the school
   praeposters.  Sorry about the Salopian slant to this stage direction - Ed.)
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///