]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.549 v7.3.549
authorBram Moolenaar <Bram@vim.org>
Wed, 13 Jun 2012 11:40:48 +0000 (13:40 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 13 Jun 2012 11:40:48 +0000 (13:40 +0200)
Problem:    In 'cinoptions' "0s" is interpreted as one shiftwidth. (David
            Pineau)
Solution:   Use the zero as zero. (Lech Lorens)

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

index 7ba3972790df28b4ca994f93e3e27617e9212256..988e368d7a52e5f03c495b1215d5c23aa03f53bf 100644 (file)
@@ -6635,6 +6635,7 @@ get_c_indent()
     int                whilelevel;
     linenr_T   lnum;
     char_u     *options;
+    char_u     *digits;
     int                fraction = 0;       /* init for GCC */
     int                divider;
     int                n;
@@ -6650,6 +6651,7 @@ get_c_indent()
        l = options++;
        if (*options == '-')
            ++options;
+       digits = options;           /* remember where the digits start */
        n = getdigits(&options);
        divider = 0;
        if (*options == '.')        /* ".5s" means a fraction */
@@ -6666,7 +6668,7 @@ get_c_indent()
        }
        if (*options == 's')        /* "2s" means two times 'shiftwidth' */
        {
-           if (n == 0 && fraction == 0)
+           if (options == digits)
                n = curbuf->b_p_sw;     /* just "s" is one 'shiftwidth' */
            else
            {
index 67fc131de0fa07f3fd471b8dbfe4f22882d03ffe..abb7750f82a37b713928b87e9cfa0f9e20543ad8 100644 (file)
@@ -975,6 +975,24 @@ main ( int first_par, /*
 
 }
 
+STARTTEST
+:set cin
+:set cino=es,n0s
+/main
+=][
+ENDTEST
+
+main(void)
+{
+       /* Make sure that cino=X0s is not parsed like cino=Xs. */
+       if (cond)
+               foo();
+       else
+       {
+               bar();
+       }
+}
+
 STARTTEST
 :set cin
 :set cino=
index 72cb75f1bb65d31dc5f176a91ec646a848b438e7..011751be8b1e50f148641ce03d701e0645c484d5 100644 (file)
@@ -940,6 +940,18 @@ main ( int first_par, /*
 }
 
 
+main(void)
+{
+       /* Make sure that cino=X0s is not parsed like cino=Xs. */
+       if (cond)
+               foo();
+       else
+       {
+               bar();
+       }
+}
+
+
 {
        do
        {
index e9f160792bff7d9cd03b6ab6ec5aa3b5775ffda5..1e5d5cdb07b619ac8097ab33d90c8185d06c3649 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    549,
 /**/
     548,
 /**/