Karsten Hopp 5b9ccd
To: vim-dev@vim.org
Karsten Hopp 5b9ccd
Subject: patch 7.0.182
Karsten Hopp 5b9ccd
Fcc: outbox
Karsten Hopp 5b9ccd
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 5b9ccd
Mime-Version: 1.0
Karsten Hopp 5b9ccd
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 5b9ccd
Content-Transfer-Encoding: 8bit
Karsten Hopp 5b9ccd
------------
Karsten Hopp 5b9ccd
Karsten Hopp 5b9ccd
Patch 7.0.182
Karsten Hopp 5b9ccd
Problem:    When using a mix of undo and "g-" it may no longer be possible to
Karsten Hopp 5b9ccd
	    go to every point in the undo tree.  (Andy Wokula)
Karsten Hopp 5b9ccd
Solution:   Correctly update pointers in the undo tree.
Karsten Hopp 5b9ccd
Files:	    src/undo.c
Karsten Hopp 5b9ccd
Karsten Hopp 5b9ccd
Karsten Hopp 5b9ccd
*** ../vim-7.0.181/src/undo.c	Tue Aug 29 17:28:56 2006
Karsten Hopp 5b9ccd
--- src/undo.c	Tue Jan  9 20:18:27 2007
Karsten Hopp 5b9ccd
***************
Karsten Hopp 5b9ccd
*** 341,351 ****
Karsten Hopp 5b9ccd
  	uhp->uh_alt_next = old_curhead;
Karsten Hopp 5b9ccd
  	if (old_curhead != NULL)
Karsten Hopp 5b9ccd
  	{
Karsten Hopp 5b9ccd
  	    old_curhead->uh_alt_prev = uhp;
Karsten Hopp 5b9ccd
  	    if (curbuf->b_u_oldhead == old_curhead)
Karsten Hopp 5b9ccd
  		curbuf->b_u_oldhead = uhp;
Karsten Hopp 5b9ccd
  	}
Karsten Hopp 5b9ccd
! 	uhp->uh_alt_prev = NULL;
Karsten Hopp 5b9ccd
  	if (curbuf->b_u_newhead != NULL)
Karsten Hopp 5b9ccd
  	    curbuf->b_u_newhead->uh_prev = uhp;
Karsten Hopp 5b9ccd
  
Karsten Hopp 5b9ccd
--- 341,355 ----
Karsten Hopp 5b9ccd
  	uhp->uh_alt_next = old_curhead;
Karsten Hopp 5b9ccd
  	if (old_curhead != NULL)
Karsten Hopp 5b9ccd
  	{
Karsten Hopp 5b9ccd
+ 	    uhp->uh_alt_prev = old_curhead->uh_alt_prev;
Karsten Hopp 5b9ccd
+ 	    if (uhp->uh_alt_prev != NULL)
Karsten Hopp 5b9ccd
+ 		uhp->uh_alt_prev->uh_alt_next = uhp;
Karsten Hopp 5b9ccd
  	    old_curhead->uh_alt_prev = uhp;
Karsten Hopp 5b9ccd
  	    if (curbuf->b_u_oldhead == old_curhead)
Karsten Hopp 5b9ccd
  		curbuf->b_u_oldhead = uhp;
Karsten Hopp 5b9ccd
  	}
Karsten Hopp 5b9ccd
! 	else
Karsten Hopp 5b9ccd
! 	    uhp->uh_alt_prev = NULL;
Karsten Hopp 5b9ccd
  	if (curbuf->b_u_newhead != NULL)
Karsten Hopp 5b9ccd
  	    curbuf->b_u_newhead->uh_prev = uhp;
Karsten Hopp 5b9ccd
  
Karsten Hopp 5b9ccd
***************
Karsten Hopp 5b9ccd
*** 856,861 ****
Karsten Hopp 5b9ccd
--- 860,870 ----
Karsten Hopp 5b9ccd
  	uhp = curbuf->b_u_curhead;
Karsten Hopp 5b9ccd
  	while (uhp != NULL)
Karsten Hopp 5b9ccd
  	{
Karsten Hopp 5b9ccd
+ 	    /* Go back to the first branch with a mark. */
Karsten Hopp 5b9ccd
+ 	    while (uhp->uh_alt_prev != NULL
Karsten Hopp 5b9ccd
+ 					&& uhp->uh_alt_prev->uh_walk == mark)
Karsten Hopp 5b9ccd
+ 		uhp = uhp->uh_alt_prev;
Karsten Hopp 5b9ccd
+ 
Karsten Hopp 5b9ccd
  	    /* Find the last branch with a mark, that's the one. */
Karsten Hopp 5b9ccd
  	    last = uhp;
Karsten Hopp 5b9ccd
  	    while (last->uh_alt_next != NULL
Karsten Hopp 5b9ccd
***************
Karsten Hopp 5b9ccd
*** 865,870 ****
Karsten Hopp 5b9ccd
--- 874,881 ----
Karsten Hopp 5b9ccd
  	    {
Karsten Hopp 5b9ccd
  		/* Make the used branch the first entry in the list of
Karsten Hopp 5b9ccd
  		 * alternatives to make "u" and CTRL-R take this branch. */
Karsten Hopp 5b9ccd
+ 		while (uhp->uh_alt_prev != NULL)
Karsten Hopp 5b9ccd
+ 		    uhp = uhp->uh_alt_prev;
Karsten Hopp 5b9ccd
  		if (last->uh_alt_next != NULL)
Karsten Hopp 5b9ccd
  		    last->uh_alt_next->uh_alt_prev = last->uh_alt_prev;
Karsten Hopp 5b9ccd
  		last->uh_alt_prev->uh_alt_next = last->uh_alt_next;
Karsten Hopp 5b9ccd
*** ../vim-7.0.181/src/version.c	Tue Jan  9 15:43:39 2007
Karsten Hopp 5b9ccd
--- src/version.c	Tue Jan  9 20:26:47 2007
Karsten Hopp 5b9ccd
***************
Karsten Hopp 5b9ccd
*** 668,669 ****
Karsten Hopp 5b9ccd
--- 668,671 ----
Karsten Hopp 5b9ccd
  {   /* Add new patch number below this line */
Karsten Hopp 5b9ccd
+ /**/
Karsten Hopp 5b9ccd
+     182,
Karsten Hopp 5b9ccd
  /**/
Karsten Hopp 5b9ccd
Karsten Hopp 5b9ccd
-- 
Karsten Hopp 5b9ccd
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 5b9ccd
13. You refer to going to the bathroom as downloading.
Karsten Hopp 5b9ccd
Karsten Hopp 5b9ccd
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 5b9ccd
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 5b9ccd
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 5b9ccd
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///