1. Steve Losh
  2. gundo.vim

Pull requests

#1 Merged
Repository
heavenshell
Branch
default
Repository
sjl
Branch
default

Add auto preview global option

Author
  1. heavenshell
Reviewers
Description

Hi,

Currently preview panel shows diff by cursor move. When there were many undolist in vim, cursor move in graph panel would became too slow.

So I add g:gundo_auto_preview option to handle auto preview. let g:gundo_auto_preview = 0 would not preview diff automatically(default is 1 to preview automatically) and moving cursor faster.

Please check and include it.

Regards.

  • Learn about pull requests

Comments (2)

  1. Steve Losh repo owner

    How do you view the diff of a change when you turn this option off?

    Normally, when you move between revisions the diff window will show you what change that particular revision did. Example:

        A -> B -> C -> D
                       ^
                       |
                 current
        time --->
    

    When you move the cursor to B it'll show you the diff between A and B.

    The `p` key shows you a preview of what would happen if you reverted to that state from your current one. If you were at B and pressed `p` it'll show you the diff from D to B, not A to B.

    I feel like Gundo becomes kind of useless without seeing the diff so you know what the undo state you're looking at is -- without it you're just looking at nodes that all look the same. I'd much rather improve the performance so it's less of an issue.

    1. heavenshell author

      Thankyou for comment!

      The `p` key shows you a preview of what would happen if you reverted to that state from your current one. If you were at B and pressed `p` it'll show you the diff from D to B, not A to B.

      Oh, sorry. I misunderstood about `p` behavior.

      I updated a patch. Press `r` key to show preview, which is just call s:GundoRenderPreview() method. when tuned off auto preview, pressing `r` would show diff from A to B.

      I'd much rather improve the performance so it's less of an issue.

      Yeah, I agree. But currently if there were too many undolist in graph window, it's hard to move cursor smoothly. My Vim CPU usage would became 100% :(

      Gundo.vim is so helpful for me to development.

      Regards,