Fix things when you've maxed out your undolevels.

This sure is ugly, but it's the only efficient way I can find to do it.

fixes issue 12
This commit is contained in:
Steve Losh 2010-10-20 18:33:48 -04:00
parent 0cfc31aeb3
commit ae996744a5

View File

@ -556,11 +556,7 @@ def _goto_window_for_buffer_name(bn):
def _undo_to(n): def _undo_to(n):
n = int(n) n = int(n)
if n == 0: if n == 0:
try: vim.command('silent earlier 999999999d')
vim.command('silent! undo 1')
except vim.error:
return
vim.command('silent undo')
else: else:
vim.command('silent undo %d' % n) vim.command('silent undo %d' % n)