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