Skip to content

Commit d22e946

Browse files
committed
patch 7.4.1574
Problem: ":undo 0" does not work. (Florent Fayolle) Solution: Make it undo all the way. (closes #688)
1 parent ce2ec0a commit d22e946

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/testdir/test_alot.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
source test_assign.vim
55
source test_cursor_func.vim
66
source test_delete.vim
7+
source test_ex_undo.vim
78
source test_expand.vim
89
source test_feedkeys.vim
910
source test_file_perm.vim

src/testdir/test_undolevels.vim

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
" Tests for 'undolevels'
22

3-
set nocompatible viminfo+=nviminfo
4-
53
func FillBuffer()
64
for i in range(1,13)
75
put=i

src/undo.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2286,7 +2286,14 @@ undo_time(
22862286
* Init "closest" to a value we can't reach. */
22872287
if (absolute)
22882288
{
2289-
target = step;
2289+
if (step == 0)
2290+
{
2291+
/* target 0 does not exist, got to 1 and above it. */
2292+
target = 1;
2293+
above = TRUE;
2294+
}
2295+
else
2296+
target = step;
22902297
closest = -1;
22912298
}
22922299
else

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,8 @@ static char *(features[]) =
743743

744744
static int included_patches[] =
745745
{ /* Add new patch number below this line */
746+
/**/
747+
1574,
746748
/**/
747749
1573,
748750
/**/

0 commit comments

Comments
 (0)