]> git.pld-linux.org Git - packages/vim.git/blob - 7.3.201
- new: 7.3.254
[packages/vim.git] / 7.3.201
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.201
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.3.201 (after 7.3.195)
11 Problem:    "} else" still causes following lines to be indented too much.
12 Solution:   Better detection for the "else" block. (Lech Lorens)
13 Files:      src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok
14
15
16 *** ../mercurial/vim73/src/misc1.c      2011-05-19 16:35:05.000000000 +0200
17 --- src/misc1.c 2011-05-25 13:29:45.000000000 +0200
18 ***************
19 *** 7541,7557 ****
20   
21                         /*
22                          * When searching for a terminated line, don't use the
23 !                        * one between the "if" and the "else".
24                          * Need to use the scope of this "else".  XXX
25                          * If whilelevel != 0 continue looking for a "do {".
26                          */
27 !                       if (cin_iselse(l)
28 !                               && whilelevel == 0
29 !                               && ((trypos = find_start_brace(ind_maxcomment))
30 !                                                                   == NULL
31                                     || find_match(LOOKFOR_IF, trypos->lnum,
32 !                                       ind_maxparen, ind_maxcomment) == FAIL))
33 !                           break;
34                     }
35   
36                     /*
37 --- 7541,7565 ----
38   
39                         /*
40                          * When searching for a terminated line, don't use the
41 !                        * one between the "if" and the matching "else".
42                          * Need to use the scope of this "else".  XXX
43                          * If whilelevel != 0 continue looking for a "do {".
44                          */
45 !                       if (cin_iselse(l) && whilelevel == 0)
46 !                       {
47 !                           /* If we're looking at "} else", let's make sure we
48 !                            * find the opening brace of the enclosing scope,
49 !                            * not the one from "if () {". */
50 !                           if (*l == '}')
51 !                               curwin->w_cursor.col =
52 !                                                  (l - ml_get_curline()) + 1;
53
54 !                           if ((trypos = find_start_brace(ind_maxcomment))
55 !                                                                      == NULL
56                                     || find_match(LOOKFOR_IF, trypos->lnum,
57 !                                       ind_maxparen, ind_maxcomment) == FAIL)
58 !                               break;
59 !                       }
60                     }
61   
62                     /*
63 *** ../mercurial/vim73/src/testdir/test3.in     2011-05-19 16:35:05.000000000 +0200
64 --- src/testdir/test3.in        2011-05-25 13:23:51.000000000 +0200
65 ***************
66 *** 1413,1418 ****
67 --- 1413,1433 ----
68   }
69   
70   STARTTEST
71 + :set cino&
72 + 2kdd=][
73 + ENDTEST
74
75 + void func(void)
76 + {
77 +       for (int i = 0; i < 10; ++i)
78 +               if (i & 1) {
79 +                       foo(1);
80 +               } else
81 +                       foo(0);
82 + baz();
83 + }
84
85 + STARTTEST
86   :g/^STARTTEST/.,/^ENDTEST/d
87   :1;/start of AUTO/,$wq! test.out
88   ENDTEST
89 *** ../mercurial/vim73/src/testdir/test3.ok     2011-05-19 16:35:05.000000000 +0200
90 --- src/testdir/test3.ok        2011-05-25 13:23:51.000000000 +0200
91 ***************
92 *** 1262,1264 ****
93 --- 1262,1275 ----
94         foo();
95   }
96   
97
98 + void func(void)
99 + {
100 +       for (int i = 0; i < 10; ++i)
101 +               if (i & 1) {
102 +                       foo(1);
103 +               } else
104 +                       foo(0);
105 +       baz();
106 + }
107
108 *** ../vim-7.3.200/src/version.c        2011-05-25 12:51:17.000000000 +0200
109 --- src/version.c       2011-05-25 13:33:16.000000000 +0200
110 ***************
111 *** 711,712 ****
112 --- 711,714 ----
113   {   /* Add new patch number below this line */
114 + /**/
115 +     201,
116   /**/
117
118 -- 
119 Laughing helps. It's like jogging on the inside.
120
121  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
122 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
123 \\\  an exciting new programming language -- http://www.Zimbu.org        ///
124  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.028821 seconds and 3 git commands to generate.