]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.249 v7.3.249
authorBram Moolenaar <Bram@vim.org>
Fri, 15 Jul 2011 12:12:30 +0000 (14:12 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 15 Jul 2011 12:12:30 +0000 (14:12 +0200)
Problem:    Wrong indenting for array initializer.
Solution:   Detect '}' in a better way. (Lech Lorens)

src/misc1.c
src/testdir/test3.in
src/testdir/test3.ok
src/version.c

index d69f12fd29ce5d0639d38a5df2e04d56921b83b2..c7f2f805961e6abb7a3ff307b98918d24c06d40c 100644 (file)
@@ -7945,8 +7945,7 @@ term_again:
                         * If we're at the end of a block, skip to the start of
                         * that block.
                         */
-                       curwin->w_cursor.col = 0;
-                       if (*cin_skipcomment(l) == '}'
+                       if (find_last_paren(l, '{', '}')
                                && (trypos = find_start_brace(ind_maxcomment))
                                                            != NULL) /* XXX */
                        {
index 1cfd8f23ee5ae89e0149c21ad874a7513abd2a0f..aea055fb3a4fec90bf2ce52b12e2fc46fa7ea475 100644 (file)
@@ -1450,6 +1450,36 @@ void func3(void)
 printf("Don't you dare indent this line incorrectly!\n);
 }
 
+STARTTEST
+:set cino&
+:set cino+=l1
+2kdd=][
+ENDTEST
+
+void func(void)
+{
+       int tab[] =
+       {
+               1, 2, 3,
+               4, 5, 6};
+
+       printf("Indent this line correctly!\n");
+
+       switch (foo)
+       {
+               case bar:
+                       printf("bar");
+                       break;
+               case baz: {
+                       printf("baz");
+                       break;
+               }
+               case quux:
+printf("But don't break the indentation of this instruction\n");
+break;
+       }
+}
+
 STARTTEST
 :set cino&
 2kdd=][
index 8475aff9feff25d9f8eebd27b751aca08aa30ee5..a47566931017f9d11bafe7fa6f88d30fd25ce3ad 100644 (file)
@@ -1308,6 +1308,31 @@ void func3(void)
 }
 
 
+void func(void)
+{
+       int tab[] =
+       {
+               1, 2, 3,
+               4, 5, 6};
+
+       printf("Indent this line correctly!\n");
+
+       switch (foo)
+       {
+               case bar:
+                       printf("bar");
+                       break;
+               case baz: {
+                       printf("baz");
+                       break;
+               }
+               case quux:
+                       printf("But don't break the indentation of this instruction\n");
+                       break;
+       }
+}
+
+
 void func(void)
 {
        cout << "a"
index a501f5e14aabcc582bcb98e938cd144229c6667f..a138681069d39898b7d5c3b4e6c4cdd48376ad1f 100644 (file)
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    249,
 /**/
     248,
 /**/