summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.395
blob: 943b44e9ec7dd1b6ab4946a3ab4548df28fc744a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
To: vim_dev@googlegroups.com
Subject: Patch 7.4.395
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.4.395 (after 7.4.355)
Problem:    C indent is wrong below an if with wrapped condition followed by
	    curly braces. (Trevor Powell)
Solution:   Make a copy of tryposBrace.
Files:	    src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok


*** ../vim-7.4.394/src/misc1.c	2014-08-06 12:49:06.711289205 +0200
--- src/misc1.c	2014-08-06 17:35:45.003165594 +0200
***************
*** 6995,7000 ****
--- 6995,7001 ----
      char_u	*linecopy;
      pos_T	*trypos;
      pos_T	*tryposBrace = NULL;
+     pos_T	tryposBraceCopy;
      pos_T	our_paren_pos;
      char_u	*start;
      int		start_brace;
***************
*** 7532,7538 ****
--- 7533,7543 ----
  	/*
  	 * We are inside braces, there is a { before this line at the position
  	 * stored in tryposBrace.
+ 	 * Make a copy of tryposBrace, it may point to pos_copy inside
+ 	 * find_start_brace(), which may be changed somewhere.
  	 */
+ 	tryposBraceCopy = *tryposBrace;
+ 	tryposBrace = &tryposBraceCopy;
  	trypos = tryposBrace;
  	ourscope = trypos->lnum;
  	start = ml_get(ourscope);
*** ../vim-7.4.394/src/testdir/test3.in	2014-07-03 22:57:51.299862927 +0200
--- src/testdir/test3.in	2014-08-06 17:19:41.099172522 +0200
***************
*** 464,469 ****
--- 464,477 ----
  	asdfasdf
  }
  
+ {
+ for ( int i = 0;
+ 	i < 10; i++ )
+ {
+ }
+ 	i = 0;
+ }
+ 
  class bob
  {
  	int foo() {return 1;}
*** ../vim-7.4.394/src/testdir/test3.ok	2014-07-03 22:57:51.299862927 +0200
--- src/testdir/test3.ok	2014-08-06 17:20:11.867172301 +0200
***************
*** 452,457 ****
--- 452,465 ----
  	asdfasdf
  }
  
+ {
+ 	for ( int i = 0;
+ 			i < 10; i++ )
+ 	{
+ 	}
+ 	i = 0;
+ }
+ 
  class bob
  {
  	int foo() {return 1;}
*** ../vim-7.4.394/src/version.c	2014-08-06 16:49:51.203185387 +0200
--- src/version.c	2014-08-06 17:43:44.243162150 +0200
***************
*** 743,744 ****
--- 743,746 ----
  {   /* Add new patch number below this line */
+ /**/
+     395,
  /**/

-- 
An operatingsystem is just a name you give to the rest of bloating
idiosyncratic machine-based-features you left out of your editor.
			(author unknown)

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///