4cfd0c756bea

added g:gundo_return_on_revert
[view raw] [browse files]
author Jacob Parker <j@cob.xxx>
date Thu, 22 Aug 2013 10:45:10 -0400
parents eb9fc8676b89
children 82d287f206dc
branches/tags (none)
files autoload/gundo.py autoload/gundo.vim doc/gundo.txt site/index.html

Changes

--- a/autoload/gundo.py	Wed Jul 10 20:37:26 2013 -0400
+++ b/autoload/gundo.py	Thu Aug 22 10:45:10 2013 -0400
@@ -515,7 +515,8 @@
     _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')
--- a/autoload/gundo.vim	Wed Jul 10 20:37:26 2013 -0400
+++ b/autoload/gundo.vim	Thu Aug 22 10:45:10 2013 -0400
@@ -52,6 +52,9 @@
 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')"{{{
--- a/doc/gundo.txt	Wed Jul 10 20:37:26 2013 -0400
+++ b/doc/gundo.txt	Thu Aug 22 10:45:10 2013 -0400
@@ -21,6 +21,7 @@
              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 @@
 
 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*
 
--- a/site/index.html	Wed Jul 10 20:37:26 2013 -0400
+++ b/site/index.html	Thu Aug 22 10:45:10 2013 -0400
@@ -101,6 +101,7 @@
                             <li><a href="#gundo_statusline">g:gundo_[preview/tree]_statusline</a></li>
                             <li><a href="#gundo_auto_preview">g:gundo_auto_preview</a></li>
                             <li><a href="#gundo_playback_delay">g:gundo_playback_delay</a></li>
+                            <li><a href="#gundo_return_on_revert">g:gundo_return_on_revert</a></li>
                         </ul>
                     </li>
                     <li><a href="#license">License</a></li>
@@ -359,6 +360,14 @@
                 </p>
 
                 <p>Default: 60</p>
+
+                <a name="gundo_return_on_revert"></a>
+                <h2>g:gundo_return_on_revert</h2>
+
+                <p>Set this to 0 to keep focus in the Gundo window after a revert.</p>
+
+                <p>Default: 1</p>
+
             </section>
             <section>
                 <a name="license"></a>