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