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

[PATCH] synchronize the autocommands for restoring the cursor

Expand Messages
  • Markus Heidelberg
    The autocommand exists in these files: runtime/doc/eval.txt runtime/doc/usr_05.txt runtime/vimrc_example.vim eval.txt contains the most up-to-date autocommand,
    Message 1 of 5 , May 17, 2009
    • 0 Attachment
      The autocommand exists in these files:
      runtime/doc/eval.txt
      runtime/doc/usr_05.txt
      runtime/vimrc_example.vim

      eval.txt contains the most up-to-date autocommand, so adjust the others
      to it:
      * don't jump when the mark is in the first line
      * use :normal! instead of :normal to avoid mappings
      * use '" instead of `" with the g command for consistency
      ---
      runtime/doc/usr_05.txt | 4 ++--
      runtime/vimrc_example.vim | 2 +-
      2 files changed, 3 insertions(+), 3 deletions(-)

      diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt
      index 0bac988..ac0d7e4 100644
      --- a/runtime/doc/usr_05.txt
      +++ b/runtime/doc/usr_05.txt
      @@ -205,8 +205,8 @@ to 78, but only locally in one file.

      *restore-cursor* >
      autocmd BufReadPost *
      - \ if line("'\"") > 0 && line("'\"") <= line("$") |
      - \ exe "normal g`\"" |
      + \ if line("'\"") > 1 && line("'\"") <= line("$") |
      + \ exe "normal! g'\"" |
      \ endif

      Another autocommand. This time it is used after reading any file. The
      diff --git a/runtime/vimrc_example.vim b/runtime/vimrc_example.vim
      index b35100c..1017eb9 100644
      --- a/runtime/vimrc_example.vim
      +++ b/runtime/vimrc_example.vim
      @@ -76,7 +76,7 @@ if has("autocmd")
      " position when opening a file.
      autocmd BufReadPost *
      \ if line("'\"") > 1 && line("'\"") <= line("$") |
      - \ exe "normal! g`\"" |
      + \ exe "normal! g'\"" |
      \ endif

      augroup END
      --
      1.6.3.1.20.ga30f


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Bram Moolenaar
      ... I think it s fine to use g` . It helps when using long lines. I ll change usr_05.txt. -- The most powerful force in the universe is gossip. /// Bram
      Message 2 of 5 , May 17, 2009
      • 0 Attachment
        Markus Heidelberg wrote:

        > The autocommand exists in these files:
        > runtime/doc/eval.txt
        > runtime/doc/usr_05.txt
        > runtime/vimrc_example.vim
        >
        > eval.txt contains the most up-to-date autocommand, so adjust the others
        > to it:
        > * don't jump when the mark is in the first line
        > * use :normal! instead of :normal to avoid mappings
        > * use '" instead of `" with the g command for consistency

        I think it's fine to use g`". It helps when using long lines.

        I'll change usr_05.txt.

        --
        The most powerful force in the universe is gossip.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ download, build and distribute -- http://www.A-A-P.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Markus Heidelberg
        ... Sure, I forgot about the difference of these two marks. Then I think eval.txt should contain g` instead of g as well. Markus
        Message 3 of 5 , May 17, 2009
        • 0 Attachment
          Bram Moolenaar, 17.05.2009:
          >
          > Markus Heidelberg wrote:
          >
          > > The autocommand exists in these files:
          > > runtime/doc/eval.txt
          > > runtime/doc/usr_05.txt
          > > runtime/vimrc_example.vim
          > >
          > > eval.txt contains the most up-to-date autocommand, so adjust the others
          > > to it:
          > > * don't jump when the mark is in the first line
          > > * use :normal! instead of :normal to avoid mappings
          > > * use '" instead of `" with the g command for consistency
          >
          > I think it's fine to use g`". It helps when using long lines.

          Sure, I forgot about the difference of these two marks.
          Then I think eval.txt should contain g`" instead of g'" as well.

          Markus


          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Markus Heidelberg
          ... The ! for :normal is still missing in usr_05.txt after the runtime updates today, I should have sent a corrected patch after your feedback. diff --git
          Message 4 of 5 , Jun 3, 2009
          • 0 Attachment
            Bram Moolenaar, 17.05.2009:
            >
            > Markus Heidelberg wrote:
            >
            > > The autocommand exists in these files:
            > > runtime/doc/eval.txt
            > > runtime/doc/usr_05.txt
            > > runtime/vimrc_example.vim
            > >
            > > eval.txt contains the most up-to-date autocommand, so adjust the others
            > > to it:
            > > * don't jump when the mark is in the first line
            > > * use :normal! instead of :normal to avoid mappings
            > > * use '" instead of `" with the g command for consistency
            >
            > I think it's fine to use g`". It helps when using long lines.
            >
            > I'll change usr_05.txt.

            The ! for :normal is still missing in usr_05.txt after the runtime
            updates today, I should have sent a corrected patch after your feedback.


            diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt
            index ff21dea..5c4de6e 100644
            --- a/runtime/doc/usr_05.txt
            +++ b/runtime/doc/usr_05.txt
            @@ -206,7 +206,7 @@ to 78, but only locally in one file.
            *restore-cursor* >
            autocmd BufReadPost *
            \ if line("'\"") > 1 && line("'\"") <= line("$") |
            - \ exe "normal g`\"" |
            + \ exe "normal! g`\"" |
            \ endif

            Another autocommand. This time it is used after reading any file. The


            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Bram Moolenaar
            ... Thanks, I fixed it now. -- The process for understanding customers primarily involves sitting around with other marketing people and talking about what you
            Message 5 of 5 , Jun 4, 2009
            • 0 Attachment
              Markus Heidelberg wrote:

              > > > The autocommand exists in these files:
              > > > runtime/doc/eval.txt
              > > > runtime/doc/usr_05.txt
              > > > runtime/vimrc_example.vim
              > > >
              > > > eval.txt contains the most up-to-date autocommand, so adjust the others
              > > > to it:
              > > > * don't jump when the mark is in the first line
              > > > * use :normal! instead of :normal to avoid mappings
              > > > * use '" instead of `" with the g command for consistency
              > >
              > > I think it's fine to use g`". It helps when using long lines.
              > >
              > > I'll change usr_05.txt.
              >
              > The ! for :normal is still missing in usr_05.txt after the runtime
              > updates today, I should have sent a corrected patch after your feedback.

              Thanks, I fixed it now.

              --
              The process for understanding customers primarily involves sitting around with
              other marketing people and talking about what you would to if you were dumb
              enough to be a customer.
              (Scott Adams - The Dilbert principle)

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
              \\\ download, build and distribute -- http://www.A-A-P.org ///
              \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_dev" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            Your message has been successfully submitted and would be delivered to recipients shortly.