99b86a7
To: vim-dev@vim.org
99b86a7
Subject: patch 7.1.111
99b86a7
Fcc: outbox
99b86a7
From: Bram Moolenaar <Bram@moolenaar.net>
99b86a7
Mime-Version: 1.0
99b86a7
Content-Type: text/plain; charset=ISO-8859-1
99b86a7
Content-Transfer-Encoding: 8bit
99b86a7
------------
99b86a7
99b86a7
Patch 7.1.111
99b86a7
Problem:    When using ":vimgrep" with the "j" flag folds from another buffer
99b86a7
	    may be displayed. (A.Politz)
99b86a7
Solution:   When not jumping to another buffer update the folds.
99b86a7
Files:	    src/quickfix.c
99b86a7
99b86a7
99b86a7
*** ../vim-7.1.110/src/quickfix.c	Thu Jun 28 21:23:52 2007
99b86a7
--- src/quickfix.c	Fri Sep 14 22:16:23 2007
99b86a7
***************
99b86a7
*** 1612,1619 ****
99b86a7
  	}
99b86a7
  
99b86a7
  	/*
99b86a7
! 	 * If there is only one window and is the quickfix window, create a new
99b86a7
! 	 * one above the quickfix window.
99b86a7
  	 */
99b86a7
  	if (((firstwin == lastwin) && bt_quickfix(curbuf)) || !usable_win)
99b86a7
  	{
99b86a7
--- 1612,1619 ----
99b86a7
  	}
99b86a7
  
99b86a7
  	/*
99b86a7
! 	 * If there is only one window and it is the quickfix window, create a
99b86a7
! 	 * new one above the quickfix window.
99b86a7
  	 */
99b86a7
  	if (((firstwin == lastwin) && bt_quickfix(curbuf)) || !usable_win)
99b86a7
  	{
99b86a7
***************
99b86a7
*** 2981,2986 ****
99b86a7
--- 2981,2987 ----
99b86a7
      buf_T	*buf;
99b86a7
      int		duplicate_name = FALSE;
99b86a7
      int		using_dummy;
99b86a7
+     int		redraw_for_dummy = FALSE;
99b86a7
      int		found_match;
99b86a7
      buf_T	*first_match_buf = NULL;
99b86a7
      time_t	seconds = 0;
99b86a7
***************
99b86a7
*** 3097,3102 ****
99b86a7
--- 3098,3104 ----
99b86a7
  	    /* Remember that a buffer with this name already exists. */
99b86a7
  	    duplicate_name = (buf != NULL);
99b86a7
  	    using_dummy = TRUE;
99b86a7
+ 	    redraw_for_dummy = TRUE;
99b86a7
  
99b86a7
  #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
99b86a7
  	    /* Don't do Filetype autocommands to avoid loading syntax and
99b86a7
***************
99b86a7
*** 3243,3252 ****
99b86a7
--- 3245,3272 ----
99b86a7
      if (qi->qf_lists[qi->qf_curlist].qf_count > 0)
99b86a7
      {
99b86a7
  	if ((flags & VGR_NOJUMP) == 0)
99b86a7
+ 	{
99b86a7
+ 	    buf = curbuf;
99b86a7
  	    qf_jump(qi, 0, 0, eap->forceit);
99b86a7
+ 	    if (buf != curbuf)
99b86a7
+ 		/* If we jumped to another buffer redrawing will already be
99b86a7
+ 		 * taken care of. */
99b86a7
+ 		redraw_for_dummy = FALSE;
99b86a7
+ 	}
99b86a7
      }
99b86a7
      else
99b86a7
  	EMSG2(_(e_nomatch2), s);
99b86a7
+ 
99b86a7
+     /* If we loaded a dummy buffer into the current window, the autocommands
99b86a7
+      * may have messed up things, need to redraw and recompute folds. */
99b86a7
+     if (redraw_for_dummy)
99b86a7
+     {
99b86a7
+ #ifdef FEAT_FOLDING
99b86a7
+ 	foldUpdateAll(curwin);
99b86a7
+ #else
99b86a7
+ 	redraw_later(NOT_VALID);
99b86a7
+ #endif
99b86a7
+     }
99b86a7
  
99b86a7
  theend:
99b86a7
      vim_free(regmatch.regprog);
99b86a7
*** ../vim-7.1.110/src/version.c	Sat Sep 15 14:48:57 2007
99b86a7
--- src/version.c	Sun Sep 16 13:23:48 2007
99b86a7
***************
99b86a7
*** 668,669 ****
99b86a7
--- 668,671 ----
99b86a7
  {   /* Add new patch number below this line */
99b86a7
+ /**/
99b86a7
+     111,
99b86a7
  /**/
99b86a7
99b86a7
-- 
99b86a7
Trees moving back and forth is what makes the wind blow.
99b86a7
99b86a7
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
99b86a7
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
99b86a7
\\\        download, build and distribute -- http://www.A-A-P.org        ///
99b86a7
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///