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