summaryrefslogtreecommitdiffstats
path: root/source/ap/vim/patches/7.2.378
blob: de2251f44b4ba75fb2c05a3ca0976c856ec8a46b (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
To: vim-dev@vim.org
Subject: Patch 7.2.378
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.2.378
Problem:    C function declaration indented too much. (Rui)
Solution:   Don't see a line containing { or } as a type. (Matt Wozniski)
Files:	    src/misc1.c


*** ../vim-7.2.377/src/misc1.c	2010-01-06 17:46:03.000000000 +0100
--- src/misc1.c	2010-02-26 22:36:50.000000000 +0100
***************
*** 7727,7737 ****
  	/*
  	 * If the NEXT line is a function declaration, the current
  	 * line needs to be indented as a function type spec.
! 	 * Don't do this if the current line looks like a comment
! 	 * or if the current line is terminated, ie. ends in ';'.
  	 */
  	else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count
  		&& !cin_nocode(theline)
  		&& !cin_ends_in(theline, (char_u *)":", NULL)
  		&& !cin_ends_in(theline, (char_u *)",", NULL)
  		&& cin_isfuncdecl(NULL, cur_curpos.lnum + 1)
--- 7727,7740 ----
  	/*
  	 * If the NEXT line is a function declaration, the current
  	 * line needs to be indented as a function type spec.
! 	 * Don't do this if the current line looks like a comment or if the
! 	 * current line is terminated, ie. ends in ';', or if the current line
! 	 * contains { or }: "void f() {\n if (1)"
  	 */
  	else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count
  		&& !cin_nocode(theline)
+ 		&& vim_strchr(theline, '{') == NULL
+ 		&& vim_strchr(theline, '}') == NULL
  		&& !cin_ends_in(theline, (char_u *)":", NULL)
  		&& !cin_ends_in(theline, (char_u *)",", NULL)
  		&& cin_isfuncdecl(NULL, cur_curpos.lnum + 1)
*** ../vim-7.2.377/src/version.c	2010-02-26 22:05:17.000000000 +0100
--- src/version.c	2010-03-02 12:30:30.000000000 +0100
***************
*** 683,684 ****
--- 683,686 ----
  {   /* Add new patch number below this line */
+ /**/
+     378,
  /**/

-- 
   An extraordinary TALL KNIGHT in all black (possibly John with Mike on his
   shoulders) walks out from the dark trees.  He is extremely fierce and
   gruesome countenance.  He walks towards KING ARTHUR and PATSY, who are
   wazzing like mad.  (Salopian slang, meaning very scared.  almost to the
   point of wetting oneself, e.g. before an important football match or
   prior to a postering.  Salopian slang meaning a beating by the school
   praeposters.  Sorry about the Salopian slant to this stage direction - Ed.)
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///