]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.395 v7.4.395
authorBram Moolenaar <Bram@vim.org>
Wed, 6 Aug 2014 15:44:14 +0000 (17:44 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 6 Aug 2014 15:44:14 +0000 (17:44 +0200)
Problem:    C indent is wrong below an if with wrapped condition followed by
            curly braces. (Trevor Powell)
Solution:   Make a copy of tryposBrace.

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

index 2c28aae84c54066af2dfe4e3a2bb40dc06328502..6ae72cfbba000f8bcc5cad78f70a80479d1991d1 100644 (file)
@@ -6995,6 +6995,7 @@ get_c_indent()
     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,7 +7533,11 @@ get_c_indent()
        /*
         * 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);
index de86700380f0e3de2f089fccb860ed11550547dd..7757569e37247576b66d7c8f81a6149ca503aa4b 100644 (file)
@@ -464,6 +464,14 @@ label:  if (asdf &&
        asdfasdf
 }
 
+{
+for ( int i = 0;
+       i < 10; i++ )
+{
+}
+       i = 0;
+}
+
 class bob
 {
        int foo() {return 1;}
index 0d0e76fce46c850b3dacda2e6f04bd011a50b5ac..e75de0ffa336eaa241e89d65662b54a25c50e226 100644 (file)
@@ -452,6 +452,14 @@ label:  if (asdf &&
        asdfasdf
 }
 
+{
+       for ( int i = 0;
+                       i < 10; i++ )
+       {
+       }
+       i = 0;
+}
+
 class bob
 {
        int foo() {return 1;}
index 082c5fc4461a7bb3e3a295dc01d4cb88098af43f..aa641559089e6d2c6c7271a87a7b811f52cc8961 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    395,
 /**/
     394,
 /**/