diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-11-11 23:37:08 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-11-11 23:37:08 +0100 |
commit | 80eaddd3a0bc47cb14168964678420cfe03a2502 (patch) | |
tree | 0e66e678c9860233e0cbcc6350a3414bd8c08c5a /src/undo.c | |
parent | 7f2e9d7c9cdfc5201a899b7b610edf64bf80c45f (diff) | |
download | vim-git-80eaddd3a0bc47cb14168964678420cfe03a2502.tar.gz |
patch 8.0.1290: seq_cur of undotree() wrong after undov8.0.1290
Problem: seq_cur of undotree() wrong after undo.
Solution: Get the actual sequence number instead of decrementing the current
one. (Ozaki Kiichi, closes #2319)
Diffstat (limited to 'src/undo.c')
-rw-r--r-- | src/undo.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/undo.c b/src/undo.c index 2c5725fa1..435decc3a 100644 --- a/src/undo.c +++ b/src/undo.c @@ -2863,9 +2863,14 @@ u_undoredo(int undo) /* Remember where we are for "g-" and ":earlier 10s". */ curbuf->b_u_seq_cur = curhead->uh_seq; if (undo) + { /* We are below the previous undo. However, to make ":earlier 1s" * work we compute this as being just above the just undone change. */ - --curbuf->b_u_seq_cur; + if (curhead->uh_next.ptr != NULL) + curbuf->b_u_seq_cur = curhead->uh_next.ptr->uh_seq; + else + curbuf->b_u_seq_cur = 0; + } /* Remember where we are for ":earlier 1f" and ":later 1f". */ if (curhead->uh_save_nr != 0) |