# HG changeset patch
# User Steve Losh <steve@stevelosh.com>
# Date 1289354184 18000
# Node ID 02ebd6ed682f83186104e1f37b0c0c6a34b29867
# Parent  d3fdfa4918f559bdbd882a28c8996b45c83243b6
Fix a bug when previewing the last change at a maxed out undolevel.

diff -r d3fdfa4918f5 -r 02ebd6ed682f plugin/gundo.vim
--- a/plugin/gundo.vim	Tue Nov 09 20:14:18 2010 -0500
+++ b/plugin/gundo.vim	Tue Nov 09 20:56:24 2010 -0500
@@ -419,7 +419,7 @@
 def _undo_to(n):
     n = int(n)
     if n == 0:
-        vim.command('silent earlier %s' % vim.eval('&undolevels'))
+        vim.command('silent earlier %s' % (int(vim.eval('&undolevels')) + 1))
     else:
         vim.command('silent undo %d' % n)