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

62389Re: Inconsistent jump after undo of multi-line change

Expand Messages
  • Jürgen Krämer
    Sep 4, 2011
    • 0 Attachment

      bootleq wrote:
      > 2011/9/5 James Vega <jamessan@... <mailto:jamessan@...>>
      >> On Sun, Sep 04, 2011 at 10:47:53AM +0800, bootleq wrote:
      >> > About the automatically added jump:
      >> > It' reasonable when undoing a single change.
      >> > But if we do many changes at one function, one undo block,
      >> > we might want to keep the cursor unchanged after undo.
      >> You can use the :keepjumps command to perform an action without altering
      >> the jump list.
      >> --
      >> James
      >> GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan@... <mailto:jamessan@...>>
      > Yes, thanks, but in this case, with
      > 1) :keepjumps | call setline(1, 'bar')
      > 2) :keepjumps | undo
      > it still jump to line 1.

      don't use bars after :keepjumps. :keepjumps takes a command as argument.
      Putting the bars there told Vim to execute :keepjumps without arguments
      (which is a no-op), and than to execute :call and :undo, respectively.


      Sometimes I think the surest sign that intelligent life exists elsewhere
      in the universe is that none of it has tried to contact us. (Calvin)

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