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

72109Re:

Expand Messages
  • Thiago Alves
    Jul 12, 2013
    • 0 Attachment
      Hi guys, I'm the author of AutoClose and since almost a year ago I gave up trying to fix all sort of problems caused by inventive solutions to "workaround" the undo break.

      I really like Bram's idea where <C-R>= would break the undo. If we have that auto complete plugins would be way more simple to implement.

      Is anyone working on this patch at this point?

      On Wednesday, July 3, 2013 1:45:32 PM UTC-7, Ben Fritz wrote:
      > I use the delimitMate plugin by Israel Chauca Fuentes:
      >
      >
      >
      > http://www.vim.org/scripts/script.php?script_id=2754
      >
      > https://github.com/Raimondi/delimitMate
      >
      >
      >
      > I found this plugin to be "the best" at automatically inserting the
      >
      > closing character for "paired" characters like (..), [..], etc. It is
      >
      > customizeable, and until recently, did not affect undo/redo/repeat.
      >
      >
      >
      > But, this plugin uses setline() internally, taking advantage of the
      >
      > "bug" fixed recently, that calling setline() in insert mode does not
      >
      > break the undo sequence. So, in Vim 7.3.1169, I can type the following:
      >
      >
      >
      > aone two three<Esc>
      >
      >
      >
      > Pressing 'u' would undo the entire insertion. With 7.3.1298, pressing
      >
      > 'u' removes each word individually, because <Space> triggers some logic
      >
      > in delimitMate.
      >
      >
      >
      > It is even more annoying when delimitMate actually inserts anything.
      >
      > Typing the following with delimitMate installed:
      >
      >
      >
      > aone two(three<Esc>
      >
      >
      >
      > Will actually insert the text:
      >
      >
      >
      > one two(three)
      >
      >
      >
      > So far, so good. Pressing '.' to repeat likewise still works. But when
      >
      > pressing 'u', in 1169 the entire insert is undone. In 1298, the first
      >
      > press gets rid of three) and the second press gets rid of the rest.
      >
      >
      >
      > Similar problems also occur when using the mapping to skip past an
      >
      > existing ) instead of inserting a new one when pressing ) in insert
      >
      > mode.
      >
      >
      >
      > I think, what is needed, is a method in insert mode, to insert text
      >
      > after the cursor and/or move the cursor, without breaking the undo
      >
      > sequence. The setline() thing was always a hack, I admit.
      >
      >
      >
      > Oddly it looks like Israel's name is on the 7.3.1200 issue description,
      >
      > so presumably he's aware of this. But the latest version of his plugin
      >
      > from GitHub breaks as described. And honestly I think it somewhat
      >
      > strange that I need a complicated plugin using setline(), etc. to avoid
      >
      > breaking undo/redo for something as simple as inserting an extra ) while
      >
      > typing in insert mode, or moving the cursor beyond the ) when typing a
      >
      > new one.

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