]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.3.550 v7.3.550
authorBram Moolenaar <Bram@vim.org>
Wed, 13 Jun 2012 12:01:41 +0000 (14:01 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 13 Jun 2012 12:01:41 +0000 (14:01 +0200)
Problem:    With "j" in 'formatoptions' a list leader is not removed. (Gary
            Johnson)
Solution:   Don't ignore the start of a three part comment. (Lech Lorens)

src/ops.c
src/testdir/test29.in
src/testdir/test29.ok
src/version.c

index 37c6aab48f0263110c77f267225ca82e0bfe24ba..5383a7c6dd5863174776de0213296f1cb55de602 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -4250,15 +4250,13 @@ skip_comment(line, process, include_space, is_comment)
        return line;
 
     /* Find:
-     * - COM_START,
      * - COM_END,
      * - colon,
      * whichever comes first.
      */
     while (*comment_flags)
     {
-       if (*comment_flags == COM_START
-               || *comment_flags == COM_END
+       if (*comment_flags == COM_END
                || *comment_flags == ':')
        {
            break;
@@ -4267,9 +4265,8 @@ skip_comment(line, process, include_space, is_comment)
     }
 
     /* If we found a colon, it means that we are not processing a line
-     * starting with an opening or a closing part of a three-part
-     * comment. That's good, because we don't want to remove those as
-     * this would be annoying.
+     * starting with a closing part of a three-part comment. That's good,
+     * because we don't want to remove those as this would be annoying.
      */
     if (*comment_flags == ':' || *comment_flags == NUL)
        line += lead_len;
index cf24642d50bdc295d7d118e3db6d1d85d012f089..2df2f7077e9f24fa923f846fcca59d5fca0d264a 100644 (file)
@@ -103,12 +103,15 @@ if (condition) // Remove the next comment leader!
 
 STARTTEST
 /^{/+1
-:set comments=s1:/*,mb:*,ex:*/,://
+:set comments=sO:*\ -,mO:*\ \ ,exO:*/
+:set comments+=s1:/*,mb:*,ex:*/,://
 :set comments+=s1:>#,mb:#,ex:#<,:<
 :set cpoptions-=j joinspaces fo=j
 :set backspace=eol,start
 :.,+3join
 j4J
+:.,+8join
+j9J
 :.,+2join
 j3J
 :.,+2join
@@ -132,6 +135,24 @@ ENDTEST
  * Make sure the previous comment leader is not removed.
  */
 
+/* List:
+ * - item1
+ *   foo bar baz
+ *   foo bar baz
+ * - item2
+ *   foo bar baz
+ *   foo bar baz
+ */
+
+/* List:
+ * - item1
+ *   foo bar baz
+ *   foo bar baz
+ * - item2
+ *   foo bar baz
+ *   foo bar baz
+ */
+
 // Should the next comment leader be left alone?
 // Yes.
 
index a5546abe844baca44d6255d92f53834d9a2bd7e7..902d52f49b22ad7925a2ad271aa7106f9611dbf5 100644 (file)
@@ -66,6 +66,8 @@ if (condition) // Remove the next comment leader! OK, I will.
 {
 /* Make sure the previous comment leader is not removed.  */
 /* Make sure the previous comment leader is not removed.  */
+/* List: item1 foo bar baz foo bar baz item2 foo bar baz foo bar baz */
+/* List: item1 foo bar baz foo bar baz item2 foo bar baz foo bar baz */
 // Should the next comment leader be left alone?  Yes.
 // Should the next comment leader be left alone?  Yes.
 /* Here the comment leader should be left intact. */ // And so should this one.
index 1e5d5cdb07b619ac8097ab33d90c8185d06c3649..e3abb957c769006a72194b44831ba816929cc176 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    550,
 /**/
     549,
 /**/