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

:25 does not save cursor position to jump list

Expand Messages
  • Dan
    These commands perform the same function: 25G 25gg ... But the first two save the cursor position to the jump list, whereas the last command does not, which I
    Message 1 of 5 , Jul 20, 2013
    • 0 Attachment
      These commands perform the same function:
      25G
      25gg
      :25<CR>

      But the first two save the cursor position to the jump list, whereas the last command does not, which I feel is inconsistent and a bug.

      For example, with the following buffer:

      1 abc
      2 def
      3 ghi

      Entering the following commands:
      :1<CR>
      :2<CR>
      :3<CR>
      <C-O> (command that moves cursor to previous line in jump list)
      <C-O>

      Should move you to lines 1, 2, 3, 2, 1 respectively, but at present the <C-O> commands do NOT move you back to lines 2 and 1.

      --
      --
      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 confirm this in gvim 7.4a.035 (Huge); however, :$ (the same command, but with $ as a line number) _does_ update the jumplist. Best regards, Tony. --
      Message 2 of 5 , Jul 20, 2013
      • 0 Attachment
        On 07/21/13 06:12, Dan wrote:
        > These commands perform the same function:
        > 25G
        > 25gg
        > :25<CR>
        >
        > But the first two save the cursor position to the jump list, whereas the last command does not, which I feel is inconsistent and a bug.
        >
        > For example, with the following buffer:
        >
        > 1 abc
        > 2 def
        > 3 ghi
        >
        > Entering the following commands:
        > :1<CR>
        > :2<CR>
        > :3<CR>
        > <C-O> (command that moves cursor to previous line in jump list)
        > <C-O>
        >
        > Should move you to lines 1, 2, 3, 2, 1 respectively, but at present the <C-O> commands do NOT move you back to lines 2 and 1.
        >

        I confirm this in gvim 7.4a.035 (Huge); however, :$<CR> (the same
        command, but with $ as a line number) _does_ update the jumplist.


        Best regards,
        Tony.
        --
        Obey all traffic laws.

        --
        --
        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 5 , Jul 21, 2013
        • 0 Attachment
          On Sun, Jul 21, 2013 at 6:12 AM, Dan <davydovdan@...> wrote:
          > These commands perform the same function:
          > 25G
          > 25gg
          > :25<CR>
          >
          > But the first two save the cursor position to the jump list, whereas the last command does not, which I feel is inconsistent and a bug.
          >
          > For example, with the following buffer:
          >
          > 1 abc
          > 2 def
          > 3 ghi
          >
          > Entering the following commands:
          > :1<CR>
          > :2<CR>
          > :3<CR>
          > <C-O> (command that moves cursor to previous line in jump list)
          > <C-O>
          >
          > Should move you to lines 1, 2, 3, 2, 1 respectively, but at present the <C-O> commands do NOT move you back to lines 2 and 1.

          This is documented. ":h jump-motions":

          > A "jump" is one of the following commands: "'", "`", "G", "/", "?",
          > "n", "N", "%", "(", ")", "[[", "]]", "{", "}", ":s", ":tag", "L", "M",
          > "H" and the commands that start editing a new file.

          --
          --
          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 Sun, Jul 21, 2013 at 6:48 AM, Tony Mechelynck ... Tony, :$, like :25, does not add an entry to the jump list. Suppose you are on the first line and move
          Message 4 of 5 , Jul 21, 2013
          • 0 Attachment
            On Sun, Jul 21, 2013 at 6:48 AM, Tony Mechelynck
            <antoine.mechelynck@...> wrote:
            > On 07/21/13 06:12, Dan wrote:
            >>
            >> These commands perform the same function:
            >> 25G
            >> 25gg
            >> :25<CR>
            >>
            >> But the first two save the cursor position to the jump list, whereas the
            >> last command does not, which I feel is inconsistent and a bug.
            >>
            >> For example, with the following buffer:
            >>
            >> 1 abc
            >> 2 def
            >> 3 ghi
            >>
            >> Entering the following commands:
            >> :1<CR>
            >> :2<CR>
            >> :3<CR>
            >> <C-O> (command that moves cursor to previous line in jump list)
            >> <C-O>
            >>
            >> Should move you to lines 1, 2, 3, 2, 1 respectively, but at present the
            >> <C-O> commands do NOT move you back to lines 2 and 1.
            >>
            >
            > I confirm this in gvim 7.4a.035 (Huge); however, :$<CR> (the same command,
            > but with $ as a line number) _does_ update the jumplist.

            Tony, :$, like :25, does not add an entry to the jump list.

            Suppose you are on the first line and move around as follows.

            3G add line 1 to the jump list
            :$
            4G add last line to the jump list
            5G add line 4 to the jump list

            Then CTRL-O will bring you back to lines 4, last, and 1 as expected.

            David

            --
            --
            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.
          • Bram Moolenaar
            ... This is intentional. -- A)bort, R)etry, D)o it right this time /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net ///
            Message 5 of 5 , Jul 21, 2013
            • 0 Attachment
              Dan wrote:

              > These commands perform the same function:
              > 25G
              > 25gg
              > :25<CR>
              >
              > But the first two save the cursor position to the jump list, whereas the last command does not, which I feel is inconsistent and a bug.
              >
              > For example, with the following buffer:
              >
              > 1 abc
              > 2 def
              > 3 ghi
              >
              > Entering the following commands:
              > :1<CR>
              > :2<CR>
              > :3<CR>
              > <C-O> (command that moves cursor to previous line in jump list)
              > <C-O>
              >
              > Should move you to lines 1, 2, 3, 2, 1 respectively, but at present
              > the <C-O> commands do NOT move you back to lines 2 and 1.

              This is intentional.

              --
              A)bort, R)etry, D)o it right this time

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

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