From df15f978899f5d7e3b5efbb0cd8d9c653a60c11b Mon Sep 17 00:00:00 2001 From: Florent FAYOLLE Date: Tue, 15 Mar 2016 22:39:30 +0100 Subject: vim-patch:7.4.1574 Problem: ":undo 0" does not work. (Florent Fayolle) Solution: Make it undo all the way. (closes vim/vim#688) https://github.com/vim/vim/commit/d22e9465f6228207a4fe722ee84371c7817060d6 --- src/nvim/undo.c | 8 +++++++- src/nvim/version.c | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 4a8a24d79d..7d9b2c7c3b 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -1782,7 +1782,13 @@ void undo_time(long step, int sec, int file, int absolute) /* "target" is the node below which we want to be. * 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 { /* When doing computations with time_t subtract starttime, because diff --git a/src/nvim/version.c b/src/nvim/version.c index 24b79e371f..98abb30b00 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -69,6 +69,7 @@ static char *features[] = { // clang-format off static int included_patches[] = { + 1574, 1570, 1511, 1366, -- cgit