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

Re: moves cursor with 'formatoptions+=r'

Expand Messages
  • Christian Brabandt
    ... Apparently, inserting the comment leader after pressing Enter confuses Vim if you then use . Here is a patch. regards, Christian -- -- You
    Message 1 of 3 , Oct 7, 2013
    • 0 Attachment
      On Mon, October 7, 2013 12:31, Wiktor Ruben wrote:
      > Hello,
      >
      > I use Vim 7.4.052.
      > Help says that <C-\><C-O> is "like CTRL-O but don't move the cursor",
      > but:
      >
      > vim -u NONE
      > :set nocp
      > :set ruler
      > :set ft=cpp
      > :set formatoptions+=r
      >
      > Put the text below:
      >
      > }<Left>//foo<CR>
      >
      > You should have:
      >
      > //foo
      > //|}
      >
      > where '|' indicates cursor position.
      >
      > Look at the ruler, the cursor position is (2,3). Now press <C-\><C-O>.
      > Cursor moves to (2,4).

      Apparently, inserting the comment leader after pressing Enter
      confuses Vim if you then use <C-\><C-O>.

      Here is a patch.


      regards,
      Christian

      --
      --
      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
      ... I can reproduce it. Only happens right after the comment leader was inserted, not when entering Insert mode in that spot in another way. Ah, Christian
      Message 2 of 3 , Oct 7, 2013
      • 0 Attachment
        Wiktor Ruben wrote:

        > I use Vim 7.4.052.
        > Help says that <C-\><C-O> is "like CTRL-O but don't move the cursor",
        > but:
        >
        > vim -u NONE
        > :set nocp
        > :set ruler
        > :set ft=cpp
        > :set formatoptions+=r
        >
        > Put the text below:
        >
        > }<Left>//foo<CR>
        >
        > You should have:
        >
        > //foo
        > //|}
        >
        > where '|' indicates cursor position.
        >
        > Look at the ruler, the cursor position is (2,3). Now press <C-\><C-O>.
        > Cursor moves to (2,4).

        I can reproduce it. Only happens right after the comment leader was
        inserted, not when entering Insert mode in that spot in another way.

        Ah, Christian already sent a patch.

        --
        Shit makes the flowers grow and that's beautiful

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