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

72106Re: Breaking undo in Insert mode

Expand Messages
  • dag.odenhall@gmail.com
    Jul 12, 2013
    • 0 Attachment

      I'd like to note that this trick never quite worked anyway. For example if you do i"test"<CR><Esc>.uu in a new buffer you end up with two empty lines even though you're at the “oldest” change. This could be another bug with setline(), I suppose.



      On Thu, Jul 11, 2013 at 6:57 PM, Ben Fritz <fritzophrenic@...> wrote:
      On Thursday, July 11, 2013 10:45:16 AM UTC-5, Christian Brabandt wrote:
      > On Thu, July 11, 2013 17:36, Ben Fritz wrote:
      >
      > > On Thursday, July 4, 2013 4:44:26 AM UTC-5, Bram Moolenaar wrote:
      >
      > >>
      >
      > >> Perhaps we can somehow detect that CTRL-R = had the side effect of
      >
      > >>
      >
      > >> changing the text and then split undo.  When it only returns the text to
      >
      > >>
      >
      > >> be inserted, there is no need to split undo.
      >
      > >>
      >
      > >
      >
      > > Even though it won't fix it all the way, I think this is a good idea. It
      >
      > > will make things a lot better at least.
      >
      > >
      >
      > > Then we can do this obviously simplified example without breaking undo:
      >
      > >
      >
      > > inoremap <Space> <C-R>="\<LT>Space>"<CR>
      >
      >
      >
      > Wouldn't in this example CTRL-R= also change the text and therefore break
      >
      > undo here as well?
      >

      It doesn't change the text directly, it only returns a value.

      Actually this mapping seems to work now that I try it again. I'm not sure what I did differently when it didn't work the first time I tried. Something is making me unable to use delimitMate, because even if set the option that makes the <Space> mapping simply return a space, the undo sequence breaks on every space insertion.

      This is closer to what is actually going on in delimitMate, but I still can't reproduce the issue. I will try again later to get a smaller example:

      function! Space()
        return "\<Space>"
      endfun

      inoremap flarbityflarb  <C-]><C-R>=Space()<CR>

      imap <Space> <C-]>flarbityflarb

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



      --
      --
      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.
       
       
    • Show all 18 messages in this topic