diff --git a/autoload/gundo.py b/autoload/gundo.py index e80dcda..3be0b81 100644 --- a/autoload/gundo.py +++ b/autoload/gundo.py @@ -515,7 +515,8 @@ def GundoRevert(): _undo_to(target_n) vim.command('GundoRenderGraph') - _goto_window_for_buffer(back) + if int(vim.eval('g:gundo_return_on_revert')): + _goto_window_for_buffer(back) if int(vim.eval('g:gundo_close_on_revert')): vim.command('GundoToggle') diff --git a/autoload/gundo.vim b/autoload/gundo.vim index 970413d..44d56a4 100644 --- a/autoload/gundo.vim +++ b/autoload/gundo.vim @@ -52,6 +52,9 @@ endif"}}} if !exists("g:gundo_playback_delay")"{{{ let g:gundo_playback_delay = 60 endif"}}} +if !exists("g:gundo_return_on_revert")"{{{ + let g:gundo_return_to_window_on_revert = 1 +endif"}}} let s:has_supported_python = 0 if g:gundo_prefer_python3 && has('python3')"{{{ diff --git a/doc/gundo.txt b/doc/gundo.txt index 82e97c2..f7f3e1e 100644 --- a/doc/gundo.txt +++ b/doc/gundo.txt @@ -21,6 +21,7 @@ CONTENTS *Gundo-contents* gundo_tree_statusline ..... |gundo_tree_statusline| 3.10 gundo_auto_preview ........ |gundo_auto_preview| 3.11 gundo_playback_delay ...... |gundo_playback_delay| + 3.12 gundo_return_on_revert .... |gundo_return_on_revert| 4. License ......................... |GundoLicense| 5. Bugs ............................ |GundoBugs| 6. Contributing .................... |GundoContributing| @@ -226,6 +227,13 @@ for a faster playback. Default: 60 +------------------------------------------------------------------------------ +3.12 g:gundo_return_on_revert *gundo_return_on_revert* + +Set this to 0 to keep focus in the Gundo window after a revert. + +Default: 1 + ============================================================================== 4. License *GundoLicense* diff --git a/site/index.html b/site/index.html index 9395e68..7760ce8 100644 --- a/site/index.html +++ b/site/index.html @@ -101,6 +101,7 @@
  • g:gundo_[preview/tree]_statusline
  • g:gundo_auto_preview
  • g:gundo_playback_delay
  • +
  • g:gundo_return_on_revert
  • License
  • @@ -359,6 +360,14 @@ let g:gundo_right = 1

    Default: 60

    + + +

    g:gundo_return_on_revert

    + +

    Set this to 0 to keep focus in the Gundo window after a revert.

    + +

    Default: 1

    +