073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.395
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.395 (after 7.4.355)
073263
Problem:    C indent is wrong below an if with wrapped condition followed by
073263
	    curly braces. (Trevor Powell)
073263
Solution:   Make a copy of tryposBrace.
073263
Files:	    src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok
073263
073263
073263
*** ../vim-7.4.394/src/misc1.c	2014-08-06 12:49:06.711289205 +0200
073263
--- src/misc1.c	2014-08-06 17:35:45.003165594 +0200
073263
***************
073263
*** 6995,7000 ****
073263
--- 6995,7001 ----
073263
      char_u	*linecopy;
073263
      pos_T	*trypos;
073263
      pos_T	*tryposBrace = NULL;
073263
+     pos_T	tryposBraceCopy;
073263
      pos_T	our_paren_pos;
073263
      char_u	*start;
073263
      int		start_brace;
073263
***************
073263
*** 7532,7538 ****
073263
--- 7533,7543 ----
073263
  	/*
073263
  	 * We are inside braces, there is a { before this line at the position
073263
  	 * stored in tryposBrace.
073263
+ 	 * Make a copy of tryposBrace, it may point to pos_copy inside
073263
+ 	 * find_start_brace(), which may be changed somewhere.
073263
  	 */
073263
+ 	tryposBraceCopy = *tryposBrace;
073263
+ 	tryposBrace = &tryposBraceCopy;
073263
  	trypos = tryposBrace;
073263
  	ourscope = trypos->lnum;
073263
  	start = ml_get(ourscope);
073263
*** ../vim-7.4.394/src/testdir/test3.in	2014-07-03 22:57:51.299862927 +0200
073263
--- src/testdir/test3.in	2014-08-06 17:19:41.099172522 +0200
073263
***************
073263
*** 464,469 ****
073263
--- 464,477 ----
073263
  	asdfasdf
073263
  }
073263
  
073263
+ {
073263
+ for ( int i = 0;
073263
+ 	i < 10; i++ )
073263
+ {
073263
+ }
073263
+ 	i = 0;
073263
+ }
073263
+ 
073263
  class bob
073263
  {
073263
  	int foo() {return 1;}
073263
*** ../vim-7.4.394/src/testdir/test3.ok	2014-07-03 22:57:51.299862927 +0200
073263
--- src/testdir/test3.ok	2014-08-06 17:20:11.867172301 +0200
073263
***************
073263
*** 452,457 ****
073263
--- 452,465 ----
073263
  	asdfasdf
073263
  }
073263
  
073263
+ {
073263
+ 	for ( int i = 0;
073263
+ 			i < 10; i++ )
073263
+ 	{
073263
+ 	}
073263
+ 	i = 0;
073263
+ }
073263
+ 
073263
  class bob
073263
  {
073263
  	int foo() {return 1;}
073263
*** ../vim-7.4.394/src/version.c	2014-08-06 16:49:51.203185387 +0200
073263
--- src/version.c	2014-08-06 17:43:44.243162150 +0200
073263
***************
073263
*** 743,744 ****
073263
--- 743,746 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     395,
073263
  /**/
073263
073263
-- 
073263
An operatingsystem is just a name you give to the rest of bloating
073263
idiosyncratic machine-based-features you left out of your editor.
073263
			(author unknown)
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///