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