# HG changeset patch # User Christian Brabandt # Date 1458060304 -3600 # Node ID 17bbbca531be618d706bb082738d064f392aa171 # Parent 3a6010bc0a55510a42e4eda6bf780f00a77943d6 commit https://github.com/vim/vim/commit/d22e9465f6228207a4fe722ee84371c7817060d6 Author: Bram Moolenaar Date: Tue Mar 15 17:43:55 2016 +0100 patch 7.4.1574 Problem: ":undo 0" does not work. (Florent Fayolle) Solution: Make it undo all the way. (closes https://github.com/vim/vim/issues/688) diff --git a/src/testdir/test_alot.vim b/src/testdir/test_alot.vim --- a/src/testdir/test_alot.vim +++ b/src/testdir/test_alot.vim @@ -4,6 +4,7 @@ source test_assign.vim source test_cursor_func.vim source test_delete.vim +source test_ex_undo.vim source test_expand.vim source test_feedkeys.vim source test_file_perm.vim diff --git a/src/testdir/test_undolevels.vim b/src/testdir/test_undolevels.vim --- a/src/testdir/test_undolevels.vim +++ b/src/testdir/test_undolevels.vim @@ -1,7 +1,5 @@ " Tests for 'undolevels' -set nocompatible viminfo+=nviminfo - func FillBuffer() for i in range(1,13) put=i diff --git a/src/undo.c b/src/undo.c --- a/src/undo.c +++ b/src/undo.c @@ -2286,7 +2286,14 @@ undo_time( * Init "closest" to a value we can't reach. */ if (absolute) { - target = step; + if (step == 0) + { + /* target 0 does not exist, got to 1 and above it. */ + target = 1; + above = TRUE; + } + else + target = step; closest = -1; } else diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -744,6 +744,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1574, +/**/ 1573, /**/ 1572,