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

Regression: Position of mark '[ points to start of = insertion, not the start of the text insertion.

Expand Messages
  • Ingo Karkat
    Hello Vim developers, When inserting text in insert mode via , if the expression register = is used, the start of the last changed text somehow gets
    Message 1 of 3 , Jul 2, 2013
    • 0 Attachment
      Hello Vim developers,

      When inserting text in insert mode via <C-R>, if the expression register
      "= is used, the start of the last changed text somehow gets reset to the
      position where the <C-R>= is triggered; i.e. any previously inserted
      text is not considered as belonging to the current insertion.

      vim -N -u NONE
      :let @@ = 'bar'
      :execute "normal! Ofoo\<C-r>\"\<Esc>"
      :echo getpos("'[")
      [0, 1, 1, 0] " Okay.

      :execute "normal! Ofoo\<C-r>=v:version\<CR>\<Esc>"
      :echo getpos("'[")
      [0, 1, 1, 0] " Okay: Vim 7.3.712 on Ubuntu 13.04/x64
      " Okay: Vim 7.3.823 on Windows 7/x64
      [0, 1, 4, 0] " BUG: Vim 7.3.1280 on Ubuntu 13.04/x64 (huge build)

      This regression is breaking plugins and macros; I found it while running
      my plugins' test suites.

      -- regards, ingo

      --
      --
      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
      ... Well, patch 7.3.1253 made CTRL-= start a new insert. Mainly to break undo, since evaluationg the expression can make unexpected changes. I suppose we can
      Message 2 of 3 , Jul 3, 2013
      • 0 Attachment
        Ingo Karkat wrote:

        > When inserting text in insert mode via <C-R>, if the expression register
        > "= is used, the start of the last changed text somehow gets reset to the
        > position where the <C-R>= is triggered; i.e. any previously inserted
        > text is not considered as belonging to the current insertion.
        >
        > vim -N -u NONE
        > :let @@ = 'bar'
        > :execute "normal! Ofoo\<C-r>\"\<Esc>"
        > :echo getpos("'[")
        > [0, 1, 1, 0] " Okay.
        >
        > :execute "normal! Ofoo\<C-r>=v:version\<CR>\<Esc>"
        > :echo getpos("'[")
        > [0, 1, 1, 0] " Okay: Vim 7.3.712 on Ubuntu 13.04/x64
        > " Okay: Vim 7.3.823 on Windows 7/x64
        > [0, 1, 4, 0] " BUG: Vim 7.3.1280 on Ubuntu 13.04/x64 (huge build)
        >
        > This regression is breaking plugins and macros; I found it while running
        > my plugins' test suites.

        Well, patch 7.3.1253 made CTRL-= start a new insert. Mainly to break
        undo, since evaluationg the expression can make unexpected changes.

        I suppose we can drop the part of the change that resets the start of
        the insert.

        --
        CRONE: Who sent you?
        ARTHUR: The Knights Who Say Ni!
        CRONE: Aaaagh! (she looks around in rear) No! We have no shrubberies here.
        "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

        /// 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.
      • Ingo Karkat
        ... Ah, I see. That s a good idea, I even go further and have this mapping ... Thanks, that fixes the problem for me! -- regards, ingo -- -- You received this
        Message 3 of 3 , Jul 3, 2013
        • 0 Attachment
          On 03-Jul-2013 13:17 +0200, Bram Moolenaar wrote:

          > Ingo Karkat wrote:
          >
          >> When inserting text in insert mode via <C-R>, if the expression register
          >> "= is used, the start of the last changed text somehow gets reset to the
          >> position where the <C-R>= is triggered; i.e. any previously inserted
          >> text is not considered as belonging to the current insertion.
          >>
          >> vim -N -u NONE
          >> :let @@ = 'bar'
          >> :execute "normal! Ofoo\<C-r>\"\<Esc>"
          >> :echo getpos("'[")
          >> [0, 1, 1, 0] " Okay.
          >>
          >> :execute "normal! Ofoo\<C-r>=v:version\<CR>\<Esc>"
          >> :echo getpos("'[")
          >> [0, 1, 1, 0] " Okay: Vim 7.3.712 on Ubuntu 13.04/x64
          >> " Okay: Vim 7.3.823 on Windows 7/x64
          >> [0, 1, 4, 0] " BUG: Vim 7.3.1280 on Ubuntu 13.04/x64 (huge build)
          >>
          >> This regression is breaking plugins and macros; I found it while running
          >> my plugins' test suites.
          >
          > Well, patch 7.3.1253 made CTRL-= start a new insert. Mainly to break
          > undo, since evaluationg the expression can make unexpected changes.

          Ah, I see. That's a good idea, I even go further and have this mapping
          (but this is just my personal preference):
          :inoremap <C-R> <C-G>u<C-R>

          > I suppose we can drop the part of the change that resets the start of
          > the insert.

          Thanks, that fixes the problem for me!

          -- regards, ingo

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