81c2858
To: vim-dev@vim.org
81c2858
Subject: Patch 7.2.161
81c2858
Fcc: outbox
81c2858
From: Bram Moolenaar <Bram@moolenaar.net>
81c2858
Mime-Version: 1.0
81c2858
Content-Type: text/plain; charset=ISO-8859-1
81c2858
Content-Transfer-Encoding: 8bit
81c2858
------------
81c2858
81c2858
Patch 7.2.161
81c2858
Problem:    Folds messed up in other tab page. (Vlad Irnov)
81c2858
Solution:   Instead of going over all windows in current tab page go over all
81c2858
	    windows in all tab pages.  Also free memory for location lists in
81c2858
	    other tab pages when exiting. (Lech Lorens)
81c2858
Files:	    src/fileio.c, src/mark.c, src/misc1.c, src/misc2.c
81c2858
81c2858
81c2858
*** ../vim-7.2.160/src/fileio.c	Wed Mar 18 15:40:03 2009
81c2858
--- src/fileio.c	Wed Apr 22 15:46:35 2009
81c2858
***************
81c2858
*** 6846,6855 ****
81c2858
  #endif
81c2858
  #ifdef FEAT_FOLDING
81c2858
  	{
81c2858
! 	    win_T *wp;
81c2858
  
81c2858
  	    /* Update folds unless they are defined manually. */
81c2858
! 	    FOR_ALL_WINDOWS(wp)
81c2858
  		if (wp->w_buffer == curwin->w_buffer
81c2858
  			&& !foldmethodIsManual(wp))
81c2858
  		    foldUpdateAll(wp);
81c2858
--- 6846,6856 ----
81c2858
  #endif
81c2858
  #ifdef FEAT_FOLDING
81c2858
  	{
81c2858
! 	    win_T	*wp;
81c2858
! 	    tabpage_T	*tp;
81c2858
  
81c2858
  	    /* Update folds unless they are defined manually. */
81c2858
! 	    FOR_ALL_TAB_WINDOWS(tp, wp)
81c2858
  		if (wp->w_buffer == curwin->w_buffer
81c2858
  			&& !foldmethodIsManual(wp))
81c2858
  		    foldUpdateAll(wp);
81c2858
*** ../vim-7.2.160/src/mark.c	Sun Nov  9 13:43:25 2008
81c2858
--- src/mark.c	Wed Apr 22 17:32:29 2009
81c2858
***************
81c2858
*** 1023,1028 ****
81c2858
--- 1023,1031 ----
81c2858
      int		fnum = curbuf->b_fnum;
81c2858
      linenr_T	*lp;
81c2858
      win_T	*win;
81c2858
+ #ifdef FEAT_WINDOWS
81c2858
+     tabpage_T	*tab;
81c2858
+ #endif
81c2858
  
81c2858
      if (line2 < line1 && amount_after == 0L)	    /* nothing to do */
81c2858
  	return;
81c2858
***************
81c2858
*** 1064,1070 ****
81c2858
  	/* quickfix marks */
81c2858
  	qf_mark_adjust(NULL, line1, line2, amount, amount_after);
81c2858
  	/* location lists */
81c2858
! 	FOR_ALL_WINDOWS(win)
81c2858
  	    qf_mark_adjust(win, line1, line2, amount, amount_after);
81c2858
  #endif
81c2858
  
81c2858
--- 1067,1073 ----
81c2858
  	/* quickfix marks */
81c2858
  	qf_mark_adjust(NULL, line1, line2, amount, amount_after);
81c2858
  	/* location lists */
81c2858
! 	FOR_ALL_TAB_WINDOWS(tab, win)
81c2858
  	    qf_mark_adjust(win, line1, line2, amount, amount_after);
81c2858
  #endif
81c2858
  
81c2858
***************
81c2858
*** 1086,1092 ****
81c2858
      /*
81c2858
       * Adjust items in all windows related to the current buffer.
81c2858
       */
81c2858
!     FOR_ALL_WINDOWS(win)
81c2858
      {
81c2858
  #ifdef FEAT_JUMPLIST
81c2858
  	if (!cmdmod.lockmarks)
81c2858
--- 1089,1095 ----
81c2858
      /*
81c2858
       * Adjust items in all windows related to the current buffer.
81c2858
       */
81c2858
!     FOR_ALL_TAB_WINDOWS(tab, win)
81c2858
      {
81c2858
  #ifdef FEAT_JUMPLIST
81c2858
  	if (!cmdmod.lockmarks)
81c2858
*** ../vim-7.2.160/src/misc1.c	Wed Mar 18 15:40:03 2009
81c2858
--- src/misc1.c	Wed Apr 22 17:32:46 2009
81c2858
***************
81c2858
*** 2717,2722 ****
81c2858
--- 2717,2725 ----
81c2858
      long	xtra;
81c2858
  {
81c2858
      win_T	*wp;
81c2858
+ #ifdef FEAT_WINDOWS
81c2858
+     tabpage_T	*tp;
81c2858
+ #endif
81c2858
      int		i;
81c2858
  #ifdef FEAT_JUMPLIST
81c2858
      int		cols;
81c2858
***************
81c2858
*** 2769,2775 ****
81c2858
  		    curbuf->b_changelistlen = JUMPLISTSIZE - 1;
81c2858
  		    mch_memmove(curbuf->b_changelist, curbuf->b_changelist + 1,
81c2858
  					  sizeof(pos_T) * (JUMPLISTSIZE - 1));
81c2858
! 		    FOR_ALL_WINDOWS(wp)
81c2858
  		    {
81c2858
  			/* Correct position in changelist for other windows on
81c2858
  			 * this buffer. */
81c2858
--- 2772,2778 ----
81c2858
  		    curbuf->b_changelistlen = JUMPLISTSIZE - 1;
81c2858
  		    mch_memmove(curbuf->b_changelist, curbuf->b_changelist + 1,
81c2858
  					  sizeof(pos_T) * (JUMPLISTSIZE - 1));
81c2858
! 		    FOR_ALL_TAB_WINDOWS(tp, wp)
81c2858
  		    {
81c2858
  			/* Correct position in changelist for other windows on
81c2858
  			 * this buffer. */
81c2858
***************
81c2858
*** 2777,2783 ****
81c2858
  			    --wp->w_changelistidx;
81c2858
  		    }
81c2858
  		}
81c2858
! 		FOR_ALL_WINDOWS(wp)
81c2858
  		{
81c2858
  		    /* For other windows, if the position in the changelist is
81c2858
  		     * at the end it stays at the end. */
81c2858
--- 2780,2786 ----
81c2858
  			    --wp->w_changelistidx;
81c2858
  		    }
81c2858
  		}
81c2858
! 		FOR_ALL_TAB_WINDOWS(tp, wp)
81c2858
  		{
81c2858
  		    /* For other windows, if the position in the changelist is
81c2858
  		     * at the end it stays at the end. */
81c2858
***************
81c2858
*** 2796,2802 ****
81c2858
  #endif
81c2858
      }
81c2858
  
81c2858
!     FOR_ALL_WINDOWS(wp)
81c2858
      {
81c2858
  	if (wp->w_buffer == curbuf)
81c2858
  	{
81c2858
--- 2799,2805 ----
81c2858
  #endif
81c2858
      }
81c2858
  
81c2858
!     FOR_ALL_TAB_WINDOWS(tp, wp)
81c2858
      {
81c2858
  	if (wp->w_buffer == curbuf)
81c2858
  	{
81c2858
*** ../vim-7.2.160/src/misc2.c	Wed Mar 11 17:27:46 2009
81c2858
--- src/misc2.c	Wed Apr 22 15:46:35 2009
81c2858
***************
81c2858
*** 1075,1085 ****
81c2858
  
81c2858
  #ifdef FEAT_QUICKFIX
81c2858
      {
81c2858
! 	win_T	*win;
81c2858
  
81c2858
  	qf_free_all(NULL);
81c2858
  	/* Free all location lists */
81c2858
! 	FOR_ALL_WINDOWS(win)
81c2858
  	    qf_free_all(win);
81c2858
      }
81c2858
  #endif
81c2858
--- 1075,1086 ----
81c2858
  
81c2858
  #ifdef FEAT_QUICKFIX
81c2858
      {
81c2858
! 	win_T	    *win;
81c2858
! 	tabpage_T   *tab;
81c2858
  
81c2858
  	qf_free_all(NULL);
81c2858
  	/* Free all location lists */
81c2858
! 	FOR_ALL_TAB_WINDOWS(tab, win)
81c2858
  	    qf_free_all(win);
81c2858
      }
81c2858
  #endif
81c2858
*** ../vim-7.2.160/src/version.c	Wed Apr 22 18:43:06 2009
81c2858
--- src/version.c	Wed Apr 29 10:59:01 2009
81c2858
***************
81c2858
*** 678,679 ****
81c2858
--- 678,681 ----
81c2858
  {   /* Add new patch number below this line */
81c2858
+ /**/
81c2858
+     161,
81c2858
  /**/
81c2858
81c2858
-- 
81c2858
CONCORDE:  Quickly, sir, come this way!
81c2858
LAUNCELOT: No!  It's not right for my idiom.  I must escape more  ... more ...
81c2858
CONCORDE:  Dramatically, sir?
81c2858
LAUNCELOT: Dramatically.
81c2858
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
81c2858
81c2858
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
81c2858
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
81c2858
\\\        download, build and distribute -- http://www.A-A-P.org        ///
81c2858
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///