Loading ...
Sorry, an error occurred while loading the content.
 

Patch 7.3.550

Expand Messages
  • Bram Moolenaar
    Patch 7.3.550 (after 7.3.541) Problem: With j in formatoptions a list leader is not removed. (Gary Johnson) Solution: Don t ignore the start of a
    Message 1 of 6 , Jun 13, 2012
      Patch 7.3.550 (after 7.3.541)
      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)
      Files: src/ops.c, src/testdir/test29.in, src/testdir/test29.ok


      *** ../vim-7.3.549/src/ops.c 2012-06-07 21:09:35.000000000 +0200
      --- src/ops.c 2012-06-13 13:48:26.000000000 +0200
      ***************
      *** 4250,4264 ****
      return line;

      /* Find:
      - * - COM_START,
      * - COM_END,
      * - colon,
      * whichever comes first.
      */
      while (*comment_flags)
      {
      ! if (*comment_flags == COM_START
      ! || *comment_flags == COM_END
      || *comment_flags == ':')
      {
      break;
      --- 4250,4262 ----
      return line;

      /* Find:
      * - COM_END,
      * - colon,
      * whichever comes first.
      */
      while (*comment_flags)
      {
      ! if (*comment_flags == COM_END
      || *comment_flags == ':')
      {
      break;
      ***************
      *** 4267,4275 ****
      }

      /* 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.
      */
      if (*comment_flags == ':' || *comment_flags == NUL)
      line += lead_len;
      --- 4265,4272 ----
      }

      /* If we found a colon, it means that we are not processing a line
      ! * 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;
      *** ../vim-7.3.549/src/testdir/test29.in 2012-06-06 16:12:54.000000000 +0200
      --- src/testdir/test29.in 2012-06-13 13:48:26.000000000 +0200
      ***************
      *** 103,114 ****

      STARTTEST
      /^{/+1
      ! :set comments=s1:/*,mb:*,ex:*/,://
      :set comments+=s1:>#,mb:#,ex:#<,:<
      :set cpoptions-=j joinspaces fo=j
      :set backspace=eol,start
      :.,+3join
      j4J
      :.,+2join
      j3J
      :.,+2join
      --- 103,117 ----

      STARTTEST
      /^{/+1
      ! :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,137 ****
      --- 135,158 ----
      * 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.

      *** ../vim-7.3.549/src/testdir/test29.ok 2012-06-06 16:12:54.000000000 +0200
      --- src/testdir/test29.ok 2012-06-13 13:48:26.000000000 +0200
      ***************
      *** 66,71 ****
      --- 66,73 ----
      {
      /* 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.
      *** ../vim-7.3.549/src/version.c 2012-06-13 13:40:45.000000000 +0200
      --- src/version.c 2012-06-13 13:50:23.000000000 +0200
      ***************
      *** 716,717 ****
      --- 716,719 ----
      { /* Add new patch number below this line */
      + /**/
      + 550,
      /**/

      --
      If you put 7 of the most talented OSS developers in a room for a week
      and asked them to fix a bug in a spreadsheet program, in 1 week
      you'd have 2 new mail readers and a text-based web browser.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ an exciting new programming language -- http://www.Zimbu.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Bram Moolenaar
      ... There is a small remaining problem: When joining a line that starts with a list header, like in the example that Gary gave, there is an extra space at the
      Message 2 of 6 , Jun 13, 2012
        I wrote:

        > Patch 7.3.550 (after 7.3.541)
        > 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)
        > Files: src/ops.c, src/testdir/test29.in, src/testdir/test29.ok

        There is a small remaining problem: When joining a line that starts with
        a list header, like in the example that Gary gave, there is an extra
        space at the point where the lines were joined.

        --
        Due knot trussed yore spell chequer two fined awl miss steaks.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Lech Lorens
        ... I can t see any spaces I wouldn t expect; for me there are only single spaces at the joining points. Can you specify explicitly what would you expect to be
        Message 3 of 6 , Jun 29, 2012
          On 13 June 2012 14:05, Bram Moolenaar <Bram@...> wrote:
          >
          > I wrote:
          >
          >> Patch 7.3.550 (after 7.3.541)
          >> 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)
          >> Files:            src/ops.c, src/testdir/test29.in, src/testdir/test29.ok
          >
          > There is a small remaining problem: When joining a line that starts with
          > a list header, like in the example that Gary gave, there is an extra
          > space at the point where the lines were joined.

          I can't see any spaces I wouldn't expect; for me there are only single
          spaces at the joining points. Can you specify explicitly what would
          you expect to be converted into what?

          Cheers,
          Lech

          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Bram Moolenaar
          ... The example that Gary used: This is the first line and this is the second line -  Now a list item -  A second list item Set filetype to vim
          Message 4 of 6 , Jun 30, 2012
            Lech Lorens wrote:

            > On 13 June 2012 14:05, Bram Moolenaar <Bram@...> wrote:
            > >
            > > I wrote:
            > >
            > >> Patch 7.3.550 (after 7.3.541)
            > >> 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)
            > >> Files:            src/ops.c, src/testdir/test29.in, src/testdir/test29.ok
            > >
            > > There is a small remaining problem: When joining a line that starts with
            > > a list header, like in the example that Gary gave, there is an extra
            > > space at the point where the lines were joined.
            >
            > I can't see any spaces I wouldn't expect; for me there are only single
            > spaces at the joining points. Can you specify explicitly what would
            > you expect to be converted into what?

            The example that Gary used:

            " This is the first line
            " and this is the second line
            " -  Now a list item
            " -  A second list item

            Set 'filetype' to "vim" and add "j" to 'formatoptions.
            Joining the last two lines leaves two spaces.
            If you add more spaces before "A second list item" they will remain
            after joining. I don't think that should happen.

            --
            hundred-and-one symptoms of being an internet addict:
            87. Everyone you know asks why your phone line is always busy ...and
            you tell them to send an e-mail.

            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
            /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
            \\\ an exciting new programming language -- http://www.Zimbu.org ///
            \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • Lech Lorens
            ... [...] ... But it doesn t work this way for me. The following file: #v+ This is the first line and this is the second line - Now a list item.
            Message 5 of 6 , Jul 1, 2012
              On 30 June 2012 13:01, Bram Moolenaar <Bram@...> wrote:
              > Lech Lorens wrote:
              [...]
              >> I can't see any spaces I wouldn't expect; for me there are only single
              >> spaces at the joining points. Can you specify explicitly what would
              >> you expect to be converted into what?
              >
              > The example that Gary used:
              >
              > " This is the first line
              > " and this is the second line
              > " - Now a list item
              > " - A second list item
              >
              > Set 'filetype' to "vim" and add "j" to 'formatoptions.
              > Joining the last two lines leaves two spaces.
              > If you add more spaces before "A second list item" they will remain
              > after joining. I don't think that should happen.


              But it doesn't work this way for me. The following file:
              #v+
              " This is the first line
              " and this is the second line
              " - Now a list item.
              " - A second list item
              " and its continuation
              #v-

              will be converted to this:

              #v+
              " This is the first line
              " and this is the second line
              " - Now a list item. A second list item and its continuation
              #v-

              with this command:

              vim -u NONE -U NONE -c 'setl com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"' \
              -c 'set nojoinspaces' \
              -c 'setl fo=j' \
              -c 'normal 3G' \
              -c '.,$join' \
              test-fo-j.txt

              It works the same way if I use the vim ftplugin. Perhaps you could
              show me what :set and :setl say for the file for which you see the
              problem?
              Or perhaps you see double spaces after a '.' and you have 'joinspaces' set?

              Thanks,
              Lech

              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            • Bram Moolenaar
              ... Weird, now I can t reproduct it anymore. -- ... /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net /// sponsor Vim, vote for
              Message 6 of 6 , Jul 1, 2012
                Lech Lorens wrote:

                > On 30 June 2012 13:01, Bram Moolenaar <Bram@...> wrote:
                > > Lech Lorens wrote:
                > [...]
                > >> I can't see any spaces I wouldn't expect; for me there are only single
                > >> spaces at the joining points. Can you specify explicitly what would
                > >> you expect to be converted into what?
                > >
                > > The example that Gary used:
                > >
                > > " This is the first line
                > > " and this is the second line
                > > " - Now a list item
                > > " - A second list item
                > >
                > > Set 'filetype' to "vim" and add "j" to 'formatoptions.
                > > Joining the last two lines leaves two spaces.
                > > If you add more spaces before "A second list item" they will remain
                > > after joining. I don't think that should happen.
                >
                >
                > But it doesn't work this way for me. The following file:
                > #v+
                > " This is the first line
                > " and this is the second line
                > " - Now a list item.
                > " - A second list item
                > " and its continuation
                > #v-
                >
                > will be converted to this:
                >
                > #v+
                > " This is the first line
                > " and this is the second line
                > " - Now a list item. A second list item and its continuation
                > #v-
                >
                > with this command:
                >
                > vim -u NONE -U NONE -c 'setl com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"' \
                > -c 'set nojoinspaces' \
                > -c 'setl fo=j' \
                > -c 'normal 3G' \
                > -c '.,$join' \
                > test-fo-j.txt
                >
                > It works the same way if I use the vim ftplugin. Perhaps you could
                > show me what :set and :setl say for the file for which you see the
                > problem?
                > Or perhaps you see double spaces after a '.' and you have 'joinspaces' set?

                Weird, now I can't reproduct it anymore.

                --
                From "know your smileys":
                :-O>-o Smiley American tourist (note big mouth and camera)

                /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                \\\ an exciting new programming language -- http://www.Zimbu.org ///
                \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                --
                You received this message from the "vim_dev" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
              Your message has been successfully submitted and would be delivered to recipients shortly.