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