0
0
mirror of https://github.com/vim/vim.git synced 2025-10-15 07:14:09 -04:00

updated for version 7.2.441

Problem:    When using ":earlier" undo information may be wrong.
Solution:   When changing alternate branches also adjust b_u_oldhead.
This commit is contained in:
Bram Moolenaar
2010-05-30 16:55:22 +02:00
parent 97bc5a52c9
commit d96699e696
2 changed files with 9 additions and 7 deletions

View File

@@ -242,7 +242,7 @@ u_save(top, bot)
} }
/* /*
* save the line "lnum" (used by ":s" and "~" command) * Save the line "lnum" (used by ":s" and "~" command).
* The line is replaced, so the new bottom line is lnum + 1. * The line is replaced, so the new bottom line is lnum + 1.
*/ */
int int
@@ -256,7 +256,7 @@ u_savesub(lnum)
} }
/* /*
* a new line is inserted before line "lnum" (used by :s command) * A new line is inserted before line "lnum" (used by :s command).
* The line is inserted, so the new bottom line is lnum + 1. * The line is inserted, so the new bottom line is lnum + 1.
*/ */
int int
@@ -270,7 +270,7 @@ u_inssub(lnum)
} }
/* /*
* save the lines "lnum" - "lnum" + nlines (used by delete command) * Save the lines "lnum" - "lnum" + nlines (used by delete command).
* The lines are deleted, so the new bottom line is lnum, unless the buffer * The lines are deleted, so the new bottom line is lnum, unless the buffer
* becomes empty. * becomes empty.
*/ */
@@ -996,6 +996,8 @@ undo_time(step, sec, absolute)
last->uh_alt_next = uhp; last->uh_alt_next = uhp;
uhp->uh_alt_prev = last; uhp->uh_alt_prev = last;
if (curbuf->b_u_oldhead == uhp)
curbuf->b_u_oldhead = last;
uhp = last; uhp = last;
if (uhp->uh_next != NULL) if (uhp->uh_next != NULL)
uhp->uh_next->uh_prev = uhp; uhp->uh_next->uh_prev = uhp;
@@ -1406,10 +1408,9 @@ u_sync(force)
/* /*
* ":undolist": List the leafs of the undo tree * ":undolist": List the leafs of the undo tree
*/ */
/*ARGSUSED*/
void void
ex_undolist(eap) ex_undolist(eap)
exarg_T *eap; exarg_T *eap UNUSED;
{ {
garray_T ga; garray_T ga;
u_header_T *uhp; u_header_T *uhp;
@@ -1529,10 +1530,9 @@ u_add_time(buf, buflen, tt)
/* /*
* ":undojoin": continue adding to the last entry list * ":undojoin": continue adding to the last entry list
*/ */
/*ARGSUSED*/
void void
ex_undojoin(eap) ex_undojoin(eap)
exarg_T *eap; exarg_T *eap UNUSED;
{ {
if (curbuf->b_u_newhead == NULL) if (curbuf->b_u_newhead == NULL)
return; /* nothing changed before */ return; /* nothing changed before */

View File

@@ -681,6 +681,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
441,
/**/ /**/
440, 440,
/**/ /**/