summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-03-15 17:43:55 +0100
committerBram Moolenaar <Bram@vim.org>2016-03-15 17:43:55 +0100
commitd22e9465f6228207a4fe722ee84371c7817060d6 (patch)
tree88c78b4173edd9f3f84ed69341d7dac225bbf286
parentce2ec0a82a778ff4d79a2c3309f6cac079d7b5ee (diff)
patch 7.4.1574v7.4.1574
Problem: ":undo 0" does not work. (Florent Fayolle) Solution: Make it undo all the way. (closes #688)
-rw-r--r--src/testdir/test_alot.vim1
-rw-r--r--src/testdir/test_undolevels.vim2
-rw-r--r--src/undo.c9
-rw-r--r--src/version.c2
4 files changed, 11 insertions, 3 deletions
diff --git a/src/testdir/test_alot.vim b/src/testdir/test_alot.vim
index 94ff8b1dac..bd74afc4aa 100644
--- 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
index 427cece24c..7bb25effb5 100644
--- 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
index 2bf815ba45..07b2781307 100644
--- 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
index c3c932381a..4779f7d876 100644
--- 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,