Mercurial > vim
comparison src/undo.c @ 12827:ff494a964ab7 v8.0.1290
patch 8.0.1290: seq_cur of undotree() wrong after undo
commit https://github.com/vim/vim/commit/80eaddd3a0bc47cb14168964678420cfe03a2502
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 11 23:37:08 2017 +0100
patch 8.0.1290: seq_cur of undotree() wrong after undo
Problem: seq_cur of undotree() wrong after undo.
Solution: Get the actual sequence number instead of decrementing the current
one. (Ozaki Kiichi, closes #2319)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 11 Nov 2017 23:45:05 +0100 |
parents | 351cf7c67bbe |
children | 8d5b451d7bab |
comparison
equal
deleted
inserted
replaced
12826:f690da1b3c04 | 12827:ff494a964ab7 |
---|---|
2861 check_cursor(); | 2861 check_cursor(); |
2862 | 2862 |
2863 /* Remember where we are for "g-" and ":earlier 10s". */ | 2863 /* Remember where we are for "g-" and ":earlier 10s". */ |
2864 curbuf->b_u_seq_cur = curhead->uh_seq; | 2864 curbuf->b_u_seq_cur = curhead->uh_seq; |
2865 if (undo) | 2865 if (undo) |
2866 { | |
2866 /* We are below the previous undo. However, to make ":earlier 1s" | 2867 /* We are below the previous undo. However, to make ":earlier 1s" |
2867 * work we compute this as being just above the just undone change. */ | 2868 * work we compute this as being just above the just undone change. */ |
2868 --curbuf->b_u_seq_cur; | 2869 if (curhead->uh_next.ptr != NULL) |
2870 curbuf->b_u_seq_cur = curhead->uh_next.ptr->uh_seq; | |
2871 else | |
2872 curbuf->b_u_seq_cur = 0; | |
2873 } | |
2869 | 2874 |
2870 /* Remember where we are for ":earlier 1f" and ":later 1f". */ | 2875 /* Remember where we are for ":earlier 1f" and ":later 1f". */ |
2871 if (curhead->uh_save_nr != 0) | 2876 if (curhead->uh_save_nr != 0) |
2872 { | 2877 { |
2873 if (undo) | 2878 if (undo) |