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

Re: The numberd register 1 does not contain the text deleted by d% when the text is less than one line.

Expand Messages
  • Tony Mechelynck
    On 22/08/13 13:48, Bohr Shaw wrote (under Subject: The numberd register 1 does not contain the text deleted by d% when the text is less than one ... I can
    Message 1 of 10 , Aug 22, 2013
      On 22/08/13 13:48, Bohr Shaw wrote (under Subject: The numberd register
      1 does not contain the text deleted by d% when the text is less than one
      line.):
      > However, the document says the register 1 always hold the text deleted by the delete operator with these movement commands:|%|, |(|, |)|, |`|, |/|, |?|, |n|, |N|, |{| and |}|.
      > I guess this is a document error.
      >
      I can reproduce this behaviour on the following executable:

      VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 22 2013 21:48:08)
      Included patches: 1-7
      Compiled by antoine.mechelynck@...
      Huge version with GTK2-GNOME GUI. Features included (+) or not (-):
      [...]


      Best regards,
      Tony.
      --
      Where there's a will, there's a relative.

      --
      --
      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

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • glts
      ... I cannot reproduce this on Vim 7.4. Just to make sure we are all on the same page, this is what I did: Start Vim with vim -Nu NONE. On the opening bracket
      Message 2 of 10 , Aug 23, 2013
        On Thu, Aug 22, 2013 at 1:27 PM, Bohr Shaw <bohrshaw@...> wrote:
        > However, the document says the register "1 always hold the text deleted by the delete operator with these movement commands:|%|, |(|, |)|, |`|, |/|, |?|, |n|, |N|, |{| and |}|.

        I cannot reproduce this on Vim 7.4.

        Just to make sure we are all on the same page, this is what I did:

        Start Vim with vim -Nu NONE.
        On the opening bracket of "one (two) three", press d%.
        Now all three registers " 1 - contain "(two)".

        I tried a few of the other operators mentioned, they also work correctly.

        --
        --
        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

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • glts
        ... -- -- 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,
        Message 3 of 10 , Aug 23, 2013
          On Fri, Aug 23, 2013 at 10:35 AM, glts <676c7473@...> wrote:
          > On Thu, Aug 22, 2013 at 1:27 PM, Bohr Shaw <bohrshaw@...> wrote:
          >> However, the document says the register "1 always hold the text deleted by the delete operator with these movement commands:|%|, |(|, |)|, |`|, |/|, |?|, |n|, |N|, |{| and |}|.
          >
          > I cannot reproduce this on Vim 7.4.
          >
          > Just to make sure we are all on the same page, this is what I did:
          >
          > Start Vim with vim -Nu NONE.
          > On the opening bracket of "one (two) three", press d%.
          > Now all three registers " 1 - contain "(two)".
          >
          > I tried a few of the other operators mentioned, they also work correctly.

          :s/operators/motions/

          --
          --
          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

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Tony Mechelynck
          ... I used an HTML file, and I pressed d% on an tag shorter than a line. Part of both and tags, and the intervening text, were deleted, but :reg
          Message 4 of 10 , Aug 23, 2013
            On 23/08/13 10:36, glts wrote:
            > On Fri, Aug 23, 2013 at 10:35 AM, glts <676c7473@...> wrote:
            >> On Thu, Aug 22, 2013 at 1:27 PM, Bohr Shaw <bohrshaw@...> wrote:
            >>> However, the document says the register "1 always hold the text deleted by the delete operator with these movement commands:|%|, |(|, |)|, |`|, |/|, |?|, |n|, |N|, |{| and |}|.
            >>
            >> I cannot reproduce this on Vim 7.4.
            >>
            >> Just to make sure we are all on the same page, this is what I did:
            >>
            >> Start Vim with vim -Nu NONE.
            >> On the opening bracket of "one (two) three", press d%.
            >> Now all three registers " 1 - contain "(two)".
            >>
            >> I tried a few of the other operators mentioned, they also work correctly.
            >
            > :s/operators/motions/
            >
            I used an HTML file, and I pressed d% on an <a> tag shorter than a line.
            Part of both <a> and </a> tags, and the intervening text, were deleted,
            but :reg showed old stuff in register 1. Then I did the same thing on a
            <div> spanning several lines, and in this case the deleted text appeared
            in register 1 as listed by :reg.

            After each test I used u to undo it. I agree that d% on an HTML tag is
            not a user's expected behaviour. I did not try the other movements, or %
            on other kinds of paired objects.

            I got the same results (no change in reg. 1) with v%d on an object
            shorter than a line.

            As said earlier, I'm using the latest gvim 7.4.007 with GTK2/GNOME2 GUI,
            and it is a Huge build.


            Best regards,
            Tony.
            --
            hundred-and-one symptoms of being an internet addict:
            1. You actually wore a blue ribbon to protest the Communications Decency
            Act.

            --
            --
            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

            ---
            You received this message because you are subscribed to the Google Groups "vim_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • glts
            On Fri, Aug 23, 2013 at 10:53 AM, Tony Mechelynck ... As ZyX mentioned, matchit remaps %. Please use vim -Nu NONE to test. ... This is expected, the exception
            Message 5 of 10 , Aug 23, 2013
              On Fri, Aug 23, 2013 at 10:53 AM, Tony Mechelynck
              <antoine.mechelynck@...> wrote:
              > On 23/08/13 10:36, glts wrote:
              >>
              >> On Fri, Aug 23, 2013 at 10:35 AM, glts <676c7473@...> wrote:
              >>>
              >>> On Thu, Aug 22, 2013 at 1:27 PM, Bohr Shaw <bohrshaw@...> wrote:
              >>>>
              >>>> However, the document says the register "1 always hold the text deleted
              >>>> by the delete operator with these movement commands:|%|, |(|, |)|, |`|, |/|,
              >>>> |?|, |n|, |N|, |{| and |}|.
              >>>
              >>>
              >>> I cannot reproduce this on Vim 7.4.
              >>>
              >>> Just to make sure we are all on the same page, this is what I did:
              >>>
              >>> Start Vim with vim -Nu NONE.
              >>> On the opening bracket of "one (two) three", press d%.
              >>> Now all three registers " 1 - contain "(two)".
              >>>
              >>> I tried a few of the other operators mentioned, they also work correctly.
              >>
              >>
              >> :s/operators/motions/
              >>
              > I used an HTML file, and I pressed d% on an <a> tag shorter than a line.
              > Part of both <a> and </a> tags, and the intervening text, were deleted, but
              > :reg showed old stuff in register 1. Then I did the same thing on a <div>
              > spanning several lines, and in this case the deleted text appeared in
              > register 1 as listed by :reg.

              As ZyX mentioned, matchit remaps %. Please use vim -Nu NONE to test.

              > I got the same results (no change in reg. 1) with v%d on an object shorter
              > than a line.

              This is expected, the exception mentioned in the help does not apply to
              operators in Visual mode. See :h "0.

              --
              --
              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

              ---
              You received this message because you are subscribed to the Google Groups "vim_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Tony Mechelynck
              ... Ah, right. With -Nu NONE, and testing on matched ( ) parentheses, the deleted text does appear in register 1. But not with -Nu NORC, since I have a
              Message 6 of 10 , Aug 23, 2013
                On 23/08/13 11:11, glts wrote:
                > On Fri, Aug 23, 2013 at 10:53 AM, Tony Mechelynck
                > <antoine.mechelynck@...> wrote:
                >> On 23/08/13 10:36, glts wrote:
                >>>
                >>> On Fri, Aug 23, 2013 at 10:35 AM, glts <676c7473@...> wrote:
                >>>>
                >>>> On Thu, Aug 22, 2013 at 1:27 PM, Bohr Shaw <bohrshaw@...> wrote:
                >>>>>
                >>>>> However, the document says the register "1 always hold the text deleted
                >>>>> by the delete operator with these movement commands:|%|, |(|, |)|, |`|, |/|,
                >>>>> |?|, |n|, |N|, |{| and |}|.
                >>>>
                >>>>
                >>>> I cannot reproduce this on Vim 7.4.
                >>>>
                >>>> Just to make sure we are all on the same page, this is what I did:
                >>>>
                >>>> Start Vim with vim -Nu NONE.
                >>>> On the opening bracket of "one (two) three", press d%.
                >>>> Now all three registers " 1 - contain "(two)".
                >>>>
                >>>> I tried a few of the other operators mentioned, they also work correctly.
                >>>
                >>>
                >>> :s/operators/motions/
                >>>
                >> I used an HTML file, and I pressed d% on an <a> tag shorter than a line.
                >> Part of both <a> and </a> tags, and the intervening text, were deleted, but
                >> :reg showed old stuff in register 1. Then I did the same thing on a <div>
                >> spanning several lines, and in this case the deleted text appeared in
                >> register 1 as listed by :reg.
                >
                > As ZyX mentioned, matchit remaps %. Please use vim -Nu NONE to test.

                Ah, right. With -Nu NONE, and testing on matched ( ) parentheses, the
                deleted text does appear in register 1. But not with -Nu NORC, since I
                have a $VIM/vimfiles/plugin/matchit.vim containing only the line

                runtime macros/matchit.vim

                So I think that the OP was also using matchit, in which case he would
                not be using the % movement "as defined in Vim" anymore than I did the
                first time.

                >
                >> I got the same results (no change in reg. 1) with v%d on an object shorter
                >> than a line.
                >
                > This is expected, the exception mentioned in the help does not apply to
                > operators in Visual mode. See :h "0.
                >


                Best regards,
                Tony.
                --
                "Science... warns me to be careful how I adopt a view which jumps
                with my preconceptions, and to require stronger evidence for such
                belief than for one to which I was previously hostile. My business
                is to teach my aspirations to conform themselves to fact, not to
                try and make facts harmonize with my aspirations."
                [Thomas Huxley, 1960]

                --
                --
                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

                ---
                You received this message because you are subscribed to the Google Groups "vim_dev" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              Your message has been successfully submitted and would be delivered to recipients shortly.