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

Re: Strange motions.

Expand Messages
  • Nikolay Pavlov
    vim-use is not a proper place to ask such question. I forwarded your message to vim-dev. Please discuss nothing here. ... -- -- You received this message from
    Message 1 of 8 , Jul 14 4:00 AM
    • 0 Attachment

      vim-use is not a proper place to ask such question. I forwarded your message to vim-dev. Please discuss nothing here.

      On Jul 14, 2013 2:12 PM, "Paul Isambert" <zappathustra@...> wrote:
      Hello all,

      Working on Leonardo’s question regarding “dd”, I stumbled on the
      following: “g$” seems to be sometimes inclusive, sometimes exclusive,
      in ways that elude me. I might be misunderstanding something, but if I
      don’t it looks like a bug to me.

      Suppose you have the following two lines:

          abc
          def

      You’re on “a” and type “dg$”; characters up to (and including) “c” are
      deleted. On the other hand, if you type “d2g$”, then deletion goes to
      “e”, leaving “f”. If you add “v” in both cases (“dvg$” and “dv2g$”)
      then the pattern is reversed: in the first case “c” is not deleted, in
      the second case “f” is deleted. So the first motion is inclusive by
      default, and the second is exclusive; “v” reverses that (as it is
      meant to do).

      Second oddity: if instead of deleting you’re moving in virtual mode,
      then the motion is always inclusive: “vg$” includes “c”, “v2g$”
      includes “f”.

      Third oddity: suppose you have one long, wrapped line instead of two
      (the tilde is supposed to indicate wrapping):

          abc
          ~ def

      Again, you’re on “a”. Deletion works as in the previous case: “c” is
      included, “f” is not. But now visual mode excludes the last character:
      “vg$” selects “ab”, not “abc”; “v2g$” excludes “f” unless it is the
      last character of the (real) line, so in this case it would be
      included, but not in the following:

          abc
          ~ def
          ~ ghi

      I’ve never really been comfortable with in-/exclusiveness of motion,
      but here it definitely doesn’t make any sense to me.

      And now a second, unrelated question, since I’m at it: “Xdd”, where
      “X” is a count, doesn’t do anything if you’re on the last line and X is
      larger than 1; in other words, Vim doesn’t delete as many lines as
      possible; instead, it deletes nothing. Now if you’re not on the last
      line, Vim does delete as many lines as possible, even if X is larger
      than the number of remaining lines; e.g. “5dd” deletes 2 lines when
      you’re on the last but one line. Is there any rationale for this
      difference in behavior?

      Best,
      Paul

      --
      --
      You received this message from the "vim_use" 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_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.


      --
      --
      You received this message from the "vim_use" 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_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
       
       
    • Paul Isambert
      ... The division of labour is not so airtight, Nikolay. I have posted on this list, and will continue to post, about things that seem strange to me, just as
      Message 2 of 8 , Jul 14 4:55 AM
      • 0 Attachment
        Nikolay Pavlov <zyx.vim@...> a écrit:
        > vim-use is not a proper place to ask such question. I forwarded your
        > message to vim-dev. Please discuss nothing here.

        The division of labour is not so airtight, Nikolay. I have posted on
        this list, and will continue to post, about things that seem strange
        to me, just as various bugs, possible improvements and other
        “develish” things have been discussed here. If what I’ve found is
        indeed a bug, I will report it as required; in the meanwhile, we’re
        discussing Vim stuff and this is a very proper place indeed. Posting
        to vim-dev only would make sense if my message had absolutely no
        relevance to the average Vim user; being an average Vim user myself
        (and consequently not subscribed to vim-dev), this here list is the
        most natural choice.

        Best,
        Paul

        > On Jul 14, 2013 2:12 PM, "Paul Isambert" <zappathustra@...> wrote:
        >
        > > Hello all,
        > >
        > > Working on Leonardo’s question regarding “dd”, I stumbled on the
        > > following: “g$” seems to be sometimes inclusive, sometimes exclusive,
        > > in ways that elude me. I might be misunderstanding something, but if I
        > > don’t it looks like a bug to me.
        > >
        > > Suppose you have the following two lines:
        > >
        > > abc
        > > def
        > >
        > > You’re on “a” and type “dg$”; characters up to (and including) “c” are
        > > deleted. On the other hand, if you type “d2g$”, then deletion goes to
        > > “e”, leaving “f”. If you add “v” in both cases (“dvg$” and “dv2g$”)
        > > then the pattern is reversed: in the first case “c” is not deleted, in
        > > the second case “f” is deleted. So the first motion is inclusive by
        > > default, and the second is exclusive; “v” reverses that (as it is
        > > meant to do).
        > >
        > > Second oddity: if instead of deleting you’re moving in virtual mode,
        > > then the motion is always inclusive: “vg$” includes “c”, “v2g$”
        > > includes “f”.
        > >
        > > Third oddity: suppose you have one long, wrapped line instead of two
        > > (the tilde is supposed to indicate wrapping):
        > >
        > > abc
        > > ~ def
        > >
        > > Again, you’re on “a”. Deletion works as in the previous case: “c” is
        > > included, “f” is not. But now visual mode excludes the last character:
        > > “vg$” selects “ab”, not “abc”; “v2g$” excludes “f” unless it is the
        > > last character of the (real) line, so in this case it would be
        > > included, but not in the following:
        > >
        > > abc
        > > ~ def
        > > ~ ghi
        > >
        > > I’ve never really been comfortable with in-/exclusiveness of motion,
        > > but here it definitely doesn’t make any sense to me.
        > >
        > > And now a second, unrelated question, since I’m at it: “Xdd”, where
        > > “X” is a count, doesn’t do anything if you’re on the last line and X is
        > > larger than 1; in other words, Vim doesn’t delete as many lines as
        > > possible; instead, it deletes nothing. Now if you’re not on the last
        > > line, Vim does delete as many lines as possible, even if X is larger
        > > than the number of remaining lines; e.g. “5dd” deletes 2 lines when
        > > you’re on the last but one line. Is there any rationale for this
        > > difference in behavior?
        > >
        > > Best,
        > > Paul
        > >
        > > --
        > > --
        > > You received this message from the "vim_use" 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_use" group.
        > > To unsubscribe from this group and stop receiving emails from it, send an
        > > email to vim_use+unsubscribe@....
        > > For more options, visit https://groups.google.com/groups/opt_out.
        > >
        > >
        > >
        >
        > --
        > --
        > You received this message from the "vim_use" 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_use" group.
        > To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        > For more options, visit https://groups.google.com/groups/opt_out.
        >
        >
        >

        --
        --
        You received this message from the "vim_use" 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_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Nikolay Pavlov
        ... Inconsistency is a bug. It was fixed right after I forwarded the message and the fact that I was incorrectly blamed for reporting the bug in the commit
        Message 3 of 8 , Jul 14 5:51 AM
        • 0 Attachment


          On Jul 14, 2013 3:56 PM, "Paul Isambert" <zappathustra@...> wrote:
          >
          > Nikolay Pavlov <zyx.vim@...> a écrit:
          > > vim-use is not a proper place to ask such question. I forwarded your
          > > message to vim-dev. Please discuss nothing here.
          >
          > The division of labour is not so airtight, Nikolay. I have posted on
          > this list, and will continue to post, about things that seem strange
          > to me, just as various bugs, possible improvements and other
          > “develish” things have been discussed here. If what I’ve found is
          > indeed a bug, I will report it as required; in the meanwhile, we’re
          > discussing Vim stuff and this is a very proper place indeed. Posting
          > to vim-dev only would make sense if my message had absolutely no
          > relevance to the average Vim user; being an average Vim user myself
          > (and consequently not subscribed to vim-dev), this here list is the
          > most natural choice.

          Inconsistency is a bug. It was fixed right after I forwarded the message and the fact that I was incorrectly blamed for reporting the bug in the commit message means that it was forwarded message that was read. If you think such thing does belong to vim-use, write two recipients: both lists.

          And note that there are nearly no bugs that do not touch vim users.

          > Best,
          > Paul
          >
          > > On Jul 14, 2013 2:12 PM, "Paul Isambert" <zappathustra@...> wrote:
          > >
          > > > Hello all,
          > > >
          > > > Working on Leonardo’s question regarding “dd”, I stumbled on the
          > > > following: “g$” seems to be sometimes inclusive, sometimes exclusive,
          > > > in ways that elude me. I might be misunderstanding something, but if I
          > > > don’t it looks like a bug to me.
          > > >
          > > > Suppose you have the following two lines:
          > > >
          > > >     abc
          > > >     def
          > > >
          > > > You’re on “a” and type “dg$”; characters up to (and including) “c” are
          > > > deleted. On the other hand, if you type “d2g$”, then deletion goes to
          > > > “e”, leaving “f”. If you add “v” in both cases (“dvg$” and “dv2g$”)
          > > > then the pattern is reversed: in the first case “c” is not deleted, in
          > > > the second case “f” is deleted. So the first motion is inclusive by
          > > > default, and the second is exclusive; “v” reverses that (as it is
          > > > meant to do).
          > > >
          > > > Second oddity: if instead of deleting you’re moving in virtual mode,
          > > > then the motion is always inclusive: “vg$” includes “c”, “v2g$”
          > > > includes “f”.
          > > >
          > > > Third oddity: suppose you have one long, wrapped line instead of two
          > > > (the tilde is supposed to indicate wrapping):
          > > >
          > > >     abc
          > > >     ~ def
          > > >
          > > > Again, you’re on “a”. Deletion works as in the previous case: “c” is
          > > > included, “f” is not. But now visual mode excludes the last character:
          > > > “vg$” selects “ab”, not “abc”; “v2g$” excludes “f” unless it is the
          > > > last character of the (real) line, so in this case it would be
          > > > included, but not in the following:
          > > >
          > > >     abc
          > > >     ~ def
          > > >     ~ ghi
          > > >
          > > > I’ve never really been comfortable with in-/exclusiveness of motion,
          > > > but here it definitely doesn’t make any sense to me.
          > > >
          > > > And now a second, unrelated question, since I’m at it: “Xdd”, where
          > > > “X” is a count, doesn’t do anything if you’re on the last line and X is
          > > > larger than 1; in other words, Vim doesn’t delete as many lines as
          > > > possible; instead, it deletes nothing. Now if you’re not on the last
          > > > line, Vim does delete as many lines as possible, even if X is larger
          > > > than the number of remaining lines; e.g. “5dd” deletes 2 lines when
          > > > you’re on the last but one line. Is there any rationale for this
          > > > difference in behavior?
          > > >
          > > > Best,
          > > > Paul
          > > >
          > > > --
          > > > --
          > > > You received this message from the "vim_use" 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_use" group.
          > > > To unsubscribe from this group and stop receiving emails from it, send an
          > > > email to vim_use+unsubscribe@....
          > > > For more options, visit https://groups.google.com/groups/opt_out.
          > > >
          > > >
          > > >
          > >
          > > --
          > > --
          > > You received this message from the "vim_use" 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_use" group.
          > > To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          > > For more options, visit https://groups.google.com/groups/opt_out.
          > >
          > >
          > >
          >
          > --
          > --
          > You received this message from the "vim_use" 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_use" group.
          > To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          > For more options, visit https://groups.google.com/groups/opt_out.
          >
          >

          --
          --
          You received this message from the "vim_use" 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_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
           
           
        • Tim Chase
          ... This is a pretty harsh rebuke for something quite apropos of this list. It might have been a peculiar as-designed behavior, or it might have been a bug.
          Message 4 of 8 , Jul 14 6:22 AM
          • 0 Attachment
            On 2013-07-14 15:00, Nikolay Pavlov wrote:
            > vim-use is not a proper place to ask such question. I forwarded your
            > message to vim-dev. Please discuss nothing here.

            This is a pretty harsh rebuke for something quite apropos of this
            list. It might have been a peculiar as-designed behavior, or it
            might have been a bug. It's also good for other members on the list
            to be aware of such peculiar behaviors that exhibit themselves in the
            running application (rather than issues in the source code itself).
            If anything, based on the list's history, it's far better (or at
            least more common) to dialog on vim-use@ until it's a confirmed bug,
            at which point the under-the-hood discussion moves to vim-dev@

            I appreciate having the issue raised here initially.

            -tim


            --
            --
            You received this message from the "vim_use" 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_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Bram Moolenaar
            ... It s very common that someone reports a bug, sends a message to vim-dev, and it turns out the user didn t read the documentation properly (since there is
            Message 5 of 8 , Jul 14 6:42 AM
            • 0 Attachment
              Paul Isambert wrote:

              > Nikolay Pavlov <zyx.vim@...> a écrit:
              > > vim-use is not a proper place to ask such question. I forwarded your
              > > message to vim-dev. Please discuss nothing here.
              >
              > The division of labour is not so airtight, Nikolay. I have posted on
              > this list, and will continue to post, about things that seem strange
              > to me, just as various bugs, possible improvements and other
              > “develish” things have been discussed here. If what I’ve found is
              > indeed a bug, I will report it as required; in the meanwhile, we’re
              > discussing Vim stuff and this is a very proper place indeed. Posting
              > to vim-dev only would make sense if my message had absolutely no
              > relevance to the average Vim user; being an average Vim user myself
              > (and consequently not subscribed to vim-dev), this here list is the
              > most natural choice.

              It's very common that someone reports a bug, sends a message to vim-dev,
              and it turns out the user didn't read the documentation properly (since
              there is so much of it). Or someone asks a question on vim-use about
              how to make something work, and it turns out to be a bug.

              Most wasteful is having discussions about what should be posted where.
              Just use common sense and be forgiving.

              --
              Eye have a spelling checker, it came with my PC;
              It plainly marks four my revue mistakes I cannot sea.
              I've run this poem threw it, I'm sure your please to no,
              It's letter perfect in it's weigh, my checker tolled me sew!

              /// 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_use" 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_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Nikolay Pavlov
              ... Ok, I must apologize then. Just thought that a) there is no reason it should not be a bug and b) bugs should only go to vim-dev because Bram takes less
              Message 6 of 8 , Jul 14 7:25 AM
              • 0 Attachment


                On Jul 14, 2013 5:21 PM, "Tim Chase" <vim@...> wrote:
                >
                > On 2013-07-14 15:00, Nikolay Pavlov wrote:
                > > vim-use is not a proper place to ask such question. I forwarded your
                > > message to vim-dev. Please discuss nothing here.
                >
                > This is a pretty harsh rebuke for something quite apropos of this
                > list.  It might have been a peculiar as-designed behavior, or it
                > might have been a bug.  It's also good for other members on the list
                > to be aware of such peculiar behaviors that exhibit themselves in the
                > running application (rather than issues in the source code itself).
                > If anything, based on the list's history, it's far better (or at
                > least more common) to dialog on vim-use@ until it's a confirmed bug,
                > at which point the under-the-hood discussion moves to vim-dev@
                >
                > I appreciate having the issue raised here initially.

                Ok, I must apologize then. Just thought that a) there is no reason it should not be a bug and b) bugs should only go to vim-dev because Bram takes less attention to vim-use.

                > -tim
                >
                >

                --
                --
                You received this message from the "vim_use" 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_use" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
                 
                 
              • Paul Isambert
                ... Nothing serious anyway; just note that IÆm not subscribed to vim-dev and do not intend to be (since most of what is posted there is way above my head).
                Message 7 of 8 , Jul 14 8:11 AM
                • 0 Attachment
                  Nikolay Pavlov <zyx.vim@...> a écrit:
                  > On Jul 14, 2013 5:21 PM, "Tim Chase" <vim@...> wrote:
                  > >
                  > > On 2013-07-14 15:00, Nikolay Pavlov wrote:
                  > > > vim-use is not a proper place to ask such question. I forwarded your
                  > > > message to vim-dev. Please discuss nothing here.
                  > >
                  > > This is a pretty harsh rebuke for something quite apropos of this
                  > > list. It might have been a peculiar as-designed behavior, or it
                  > > might have been a bug. It's also good for other members on the list
                  > > to be aware of such peculiar behaviors that exhibit themselves in the
                  > > running application (rather than issues in the source code itself).
                  > > If anything, based on the list's history, it's far better (or at
                  > > least more common) to dialog on vim-use@ until it's a confirmed bug,
                  > > at which point the under-the-hood discussion moves to vim-dev@
                  > >
                  > > I appreciate having the issue raised here initially.
                  >
                  > Ok, I must apologize then. Just thought that a) there is no reason it
                  > should not be a bug and b) bugs should only go to vim-dev because Bram
                  > takes less attention to vim-use.

                  Nothing serious anyway; just note that I’m not subscribed to vim-dev
                  and do not intend to be (since most of what is posted there is way
                  above my head).

                  For those interested, Bram answered my message and the result is: “g$”
                  is buggy, at least in “d<count>g$” (the visual version is less clear,
                  see below), and will be patched accordingly. As for “<count>dd”,
                  that’s normal (apparently Vi-compatible) behavior.

                  Bram, about “vg$”: my “selection” is exclusive; if set to inclusive,
                  then in

                  abc
                  ~ def
                  ~ ghi

                  (where the tilde again indicates a wrapped line), “v<count>g$” (from
                  “a”) properly includes the last character of the apparent line;
                  actually “v3g$” includes the end-of-line (I suppose), so that with “d”
                  for instance the next line is joined to the current one. I suppose
                  that’s normal.

                  Best,
                  Paul

                  --
                  --
                  You received this message from the "vim_use" 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_use" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+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.