Karsten Hopp 4d38a5
To: vim-dev@vim.org
Karsten Hopp 4d38a5
Subject: Patch 7.2.041
Karsten Hopp 4d38a5
Fcc: outbox
Karsten Hopp 4d38a5
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 4d38a5
Mime-Version: 1.0
Karsten Hopp 4d38a5
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 4d38a5
Content-Transfer-Encoding: 8bit
Karsten Hopp 4d38a5
------------
Karsten Hopp 4d38a5
Karsten Hopp 4d38a5
Patch 7.2.041
Karsten Hopp 4d38a5
Problem:    In diff mode, when using two tabs, each with two diffed buffers,
Karsten Hopp 4d38a5
	    editing a buffer of the other tab messes up the diff.  (Matt
Karsten Hopp 4d38a5
	    Mzyzik)
Karsten Hopp 4d38a5
Solution:   Only copy options from a window where the buffer was edited that
Karsten Hopp 4d38a5
	    doesn't have 'diff' set or is for the current tab page.
Karsten Hopp 4d38a5
	    Also fix that window options for a buffer are stored with the
Karsten Hopp 4d38a5
	    wrong window.
Karsten Hopp 4d38a5
Files:	    src/buffer.c, src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c,
Karsten Hopp 4d38a5
	    src/ex_getln.c, src/if_sniff.c, src/main.c, src/netbeans.c,
Karsten Hopp 4d38a5
	    src/normal.c, src/popupmnu.c, src/proto/buffer.pro,
Karsten Hopp 4d38a5
	    src/proto/ex_cmds.pro src/quickfix.c, src/window.c
Karsten Hopp 4d38a5
Karsten Hopp 4d38a5
Karsten Hopp 4d38a5
*** ../vim-7.2.040/src/buffer.c	Wed Nov 12 12:51:38 2008
Karsten Hopp 4d38a5
--- src/buffer.c	Wed Nov 12 17:45:01 2008
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 33,39 ****
Karsten Hopp 4d38a5
  static char_u	*fname_match __ARGS((regprog_T *prog, char_u *name));
Karsten Hopp 4d38a5
  #endif
Karsten Hopp 4d38a5
  static void	buflist_setfpos __ARGS((buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options));
Karsten Hopp 4d38a5
! static wininfo_T *find_wininfo __ARGS((buf_T *buf));
Karsten Hopp 4d38a5
  #ifdef UNIX
Karsten Hopp 4d38a5
  static buf_T	*buflist_findname_stat __ARGS((char_u *ffname, struct stat *st));
Karsten Hopp 4d38a5
  static int	otherfile_buf __ARGS((buf_T *buf, char_u *ffname, struct stat *stp));
Karsten Hopp 4d38a5
--- 33,39 ----
Karsten Hopp 4d38a5
  static char_u	*fname_match __ARGS((regprog_T *prog, char_u *name));
Karsten Hopp 4d38a5
  #endif
Karsten Hopp 4d38a5
  static void	buflist_setfpos __ARGS((buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options));
Karsten Hopp 4d38a5
! static wininfo_T *find_wininfo __ARGS((buf_T *buf, int skip_diff_buffer));
Karsten Hopp 4d38a5
  #ifdef UNIX
Karsten Hopp 4d38a5
  static buf_T	*buflist_findname_stat __ARGS((char_u *ffname, struct stat *st));
Karsten Hopp 4d38a5
  static int	otherfile_buf __ARGS((buf_T *buf, char_u *ffname, struct stat *stp));
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 1093,1099 ****
Karsten Hopp 4d38a5
  #endif
Karsten Hopp 4d38a5
  	    setpcmark();
Karsten Hopp 4d38a5
  	    retval = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE,
Karsten Hopp 4d38a5
! 						  forceit ? ECMD_FORCEIT : 0);
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  	    /*
Karsten Hopp 4d38a5
  	     * do_ecmd() may create a new buffer, then we have to delete
Karsten Hopp 4d38a5
--- 1093,1099 ----
Karsten Hopp 4d38a5
  #endif
Karsten Hopp 4d38a5
  	    setpcmark();
Karsten Hopp 4d38a5
  	    retval = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE,
Karsten Hopp 4d38a5
! 					  forceit ? ECMD_FORCEIT : 0, curwin);
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  	    /*
Karsten Hopp 4d38a5
  	     * do_ecmd() may create a new buffer, then we have to delete
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 1316,1322 ****
Karsten Hopp 4d38a5
      setpcmark();
Karsten Hopp 4d38a5
      if (!cmdmod.keepalt)
Karsten Hopp 4d38a5
  	curwin->w_alt_fnum = curbuf->b_fnum; /* remember alternate file */
Karsten Hopp 4d38a5
!     buflist_altfpos();			 /* remember curpos */
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  #ifdef FEAT_VISUAL
Karsten Hopp 4d38a5
      /* Don't restart Select mode after switching to another buffer. */
Karsten Hopp 4d38a5
--- 1316,1322 ----
Karsten Hopp 4d38a5
      setpcmark();
Karsten Hopp 4d38a5
      if (!cmdmod.keepalt)
Karsten Hopp 4d38a5
  	curwin->w_alt_fnum = curbuf->b_fnum; /* remember alternate file */
Karsten Hopp 4d38a5
!     buflist_altfpos(curwin);			 /* remember curpos */
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  #ifdef FEAT_VISUAL
Karsten Hopp 4d38a5
      /* Don't restart Select mode after switching to another buffer. */
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 2404,2425 ****
Karsten Hopp 4d38a5
      return;
Karsten Hopp 4d38a5
  }
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  /*
Karsten Hopp 4d38a5
   * Find info for the current window in buffer "buf".
Karsten Hopp 4d38a5
   * If not found, return the info for the most recently used window.
Karsten Hopp 4d38a5
   * Returns NULL when there isn't any info.
Karsten Hopp 4d38a5
   */
Karsten Hopp 4d38a5
      static wininfo_T *
Karsten Hopp 4d38a5
! find_wininfo(buf)
Karsten Hopp 4d38a5
      buf_T	*buf;
Karsten Hopp 4d38a5
  {
Karsten Hopp 4d38a5
      wininfo_T	*wip;
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
      for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next)
Karsten Hopp 4d38a5
! 	if (wip->wi_win == curwin)
Karsten Hopp 4d38a5
  	    break;
Karsten Hopp 4d38a5
!     if (wip == NULL)	/* if no fpos for curwin, use the first in the list */
Karsten Hopp 4d38a5
! 	wip = buf->b_wininfo;
Karsten Hopp 4d38a5
      return wip;
Karsten Hopp 4d38a5
  }
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
--- 2404,2473 ----
Karsten Hopp 4d38a5
      return;
Karsten Hopp 4d38a5
  }
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
+ #ifdef FEAT_DIFF
Karsten Hopp 4d38a5
+ static int wininfo_other_tab_diff __ARGS((wininfo_T *wip));
Karsten Hopp 4d38a5
+ 
Karsten Hopp 4d38a5
+ /*
Karsten Hopp 4d38a5
+  * Return TRUE when "wip" has 'diff' set and the diff is only for another tab
Karsten Hopp 4d38a5
+  * page.  That's because a diff is local to a tab page.
Karsten Hopp 4d38a5
+  */
Karsten Hopp 4d38a5
+     static int
Karsten Hopp 4d38a5
+ wininfo_other_tab_diff(wip)
Karsten Hopp 4d38a5
+     wininfo_T	*wip;
Karsten Hopp 4d38a5
+ {
Karsten Hopp 4d38a5
+     win_T	*wp;
Karsten Hopp 4d38a5
+ 
Karsten Hopp 4d38a5
+     if (wip->wi_opt.wo_diff)
Karsten Hopp 4d38a5
+     {
Karsten Hopp 4d38a5
+ 	for (wp = firstwin; wp != NULL; wp = wp->w_next)
Karsten Hopp 4d38a5
+ 	    /* return FALSE when it's a window in the current tab page, thus
Karsten Hopp 4d38a5
+ 	     * the buffer was in diff mode here */
Karsten Hopp 4d38a5
+ 	    if (wip->wi_win == wp)
Karsten Hopp 4d38a5
+ 		return FALSE;
Karsten Hopp 4d38a5
+ 	return TRUE;
Karsten Hopp 4d38a5
+     }
Karsten Hopp 4d38a5
+     return FALSE;
Karsten Hopp 4d38a5
+ }
Karsten Hopp 4d38a5
+ #endif
Karsten Hopp 4d38a5
+ 
Karsten Hopp 4d38a5
  /*
Karsten Hopp 4d38a5
   * Find info for the current window in buffer "buf".
Karsten Hopp 4d38a5
   * If not found, return the info for the most recently used window.
Karsten Hopp 4d38a5
+  * When "skip_diff_buffer" is TRUE avoid windows with 'diff' set that is in
Karsten Hopp 4d38a5
+  * another tab page.
Karsten Hopp 4d38a5
   * Returns NULL when there isn't any info.
Karsten Hopp 4d38a5
   */
Karsten Hopp 4d38a5
+ /*ARGSUSED*/
Karsten Hopp 4d38a5
      static wininfo_T *
Karsten Hopp 4d38a5
! find_wininfo(buf, skip_diff_buffer)
Karsten Hopp 4d38a5
      buf_T	*buf;
Karsten Hopp 4d38a5
+     int		skip_diff_buffer;
Karsten Hopp 4d38a5
  {
Karsten Hopp 4d38a5
      wininfo_T	*wip;
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
      for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next)
Karsten Hopp 4d38a5
! 	if (wip->wi_win == curwin
Karsten Hopp 4d38a5
! #ifdef FEAT_DIFF
Karsten Hopp 4d38a5
! 		&& (!skip_diff_buffer || !wininfo_other_tab_diff(wip))
Karsten Hopp 4d38a5
! #endif
Karsten Hopp 4d38a5
! 	   )
Karsten Hopp 4d38a5
  	    break;
Karsten Hopp 4d38a5
! 
Karsten Hopp 4d38a5
!     /* If no wininfo for curwin, use the first in the list (that doesn't have
Karsten Hopp 4d38a5
!      * 'diff' set and is in another tab page). */
Karsten Hopp 4d38a5
!     if (wip == NULL)
Karsten Hopp 4d38a5
!     {
Karsten Hopp 4d38a5
! #ifdef FEAT_DIFF
Karsten Hopp 4d38a5
! 	if (skip_diff_buffer)
Karsten Hopp 4d38a5
! 	{
Karsten Hopp 4d38a5
! 	    for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next)
Karsten Hopp 4d38a5
! 		if (!wininfo_other_tab_diff(wip))
Karsten Hopp 4d38a5
! 		    break;
Karsten Hopp 4d38a5
! 	}
Karsten Hopp 4d38a5
! 	else
Karsten Hopp 4d38a5
! #endif
Karsten Hopp 4d38a5
! 	    wip = buf->b_wininfo;
Karsten Hopp 4d38a5
!     }
Karsten Hopp 4d38a5
      return wip;
Karsten Hopp 4d38a5
  }
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 2440,2446 ****
Karsten Hopp 4d38a5
      clearFolding(curwin);
Karsten Hopp 4d38a5
  #endif
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
!     wip = find_wininfo(buf);
Karsten Hopp 4d38a5
      if (wip != NULL && wip->wi_optset)
Karsten Hopp 4d38a5
      {
Karsten Hopp 4d38a5
  	copy_winopt(&wip->wi_opt, &curwin->w_onebuf_opt);
Karsten Hopp 4d38a5
--- 2488,2494 ----
Karsten Hopp 4d38a5
      clearFolding(curwin);
Karsten Hopp 4d38a5
  #endif
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
!     wip = find_wininfo(buf, TRUE);
Karsten Hopp 4d38a5
      if (wip != NULL && wip->wi_optset)
Karsten Hopp 4d38a5
      {
Karsten Hopp 4d38a5
  	copy_winopt(&wip->wi_opt, &curwin->w_onebuf_opt);
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 2472,2478 ****
Karsten Hopp 4d38a5
      wininfo_T	*wip;
Karsten Hopp 4d38a5
      static pos_T no_position = {1, 0};
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
!     wip = find_wininfo(buf);
Karsten Hopp 4d38a5
      if (wip != NULL)
Karsten Hopp 4d38a5
  	return &(wip->wi_fpos);
Karsten Hopp 4d38a5
      else
Karsten Hopp 4d38a5
--- 2520,2526 ----
Karsten Hopp 4d38a5
      wininfo_T	*wip;
Karsten Hopp 4d38a5
      static pos_T no_position = {1, 0};
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
!     wip = find_wininfo(buf, FALSE);
Karsten Hopp 4d38a5
      if (wip != NULL)
Karsten Hopp 4d38a5
  	return &(wip->wi_fpos);
Karsten Hopp 4d38a5
      else
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 2793,2806 ****
Karsten Hopp 4d38a5
  #endif
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  /*
Karsten Hopp 4d38a5
!  * Set alternate cursor position for current window.
Karsten Hopp 4d38a5
   * Also save the local window option values.
Karsten Hopp 4d38a5
   */
Karsten Hopp 4d38a5
      void
Karsten Hopp 4d38a5
! buflist_altfpos()
Karsten Hopp 4d38a5
  {
Karsten Hopp 4d38a5
!     buflist_setfpos(curbuf, curwin, curwin->w_cursor.lnum,
Karsten Hopp 4d38a5
! 						  curwin->w_cursor.col, TRUE);
Karsten Hopp 4d38a5
  }
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  /*
Karsten Hopp 4d38a5
--- 2841,2854 ----
Karsten Hopp 4d38a5
  #endif
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  /*
Karsten Hopp 4d38a5
!  * Set alternate cursor position for the current buffer and window "win".
Karsten Hopp 4d38a5
   * Also save the local window option values.
Karsten Hopp 4d38a5
   */
Karsten Hopp 4d38a5
      void
Karsten Hopp 4d38a5
! buflist_altfpos(win)
Karsten Hopp 4d38a5
!     win_T *win;
Karsten Hopp 4d38a5
  {
Karsten Hopp 4d38a5
!     buflist_setfpos(curbuf, win, win->w_cursor.lnum, win->w_cursor.col, TRUE);
Karsten Hopp 4d38a5
  }
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  /*
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 4492,4498 ****
Karsten Hopp 4d38a5
  		      ECMD_ONE,
Karsten Hopp 4d38a5
  		      ((P_HID(curwin->w_buffer)
Karsten Hopp 4d38a5
  			   || bufIsChanged(curwin->w_buffer)) ? ECMD_HIDE : 0)
Karsten Hopp 4d38a5
! 							       + ECMD_OLDBUF);
Karsten Hopp 4d38a5
  #ifdef FEAT_AUTOCMD
Karsten Hopp 4d38a5
  	    if (use_firstwin)
Karsten Hopp 4d38a5
  		++autocmd_no_leave;
Karsten Hopp 4d38a5
--- 4540,4546 ----
Karsten Hopp 4d38a5
  		      ECMD_ONE,
Karsten Hopp 4d38a5
  		      ((P_HID(curwin->w_buffer)
Karsten Hopp 4d38a5
  			   || bufIsChanged(curwin->w_buffer)) ? ECMD_HIDE : 0)
Karsten Hopp 4d38a5
! 						       + ECMD_OLDBUF, curwin);
Karsten Hopp 4d38a5
  #ifdef FEAT_AUTOCMD
Karsten Hopp 4d38a5
  	    if (use_firstwin)
Karsten Hopp 4d38a5
  		++autocmd_no_leave;
Karsten Hopp 4d38a5
*** ../vim-7.2.040/src/ex_cmds.c	Sun Nov  9 13:43:25 2008
Karsten Hopp 4d38a5
--- src/ex_cmds.c	Wed Nov 12 22:41:41 2008
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 3052,3058 ****
Karsten Hopp 4d38a5
  	retval = 0;	/* it's in the same file */
Karsten Hopp 4d38a5
      }
Karsten Hopp 4d38a5
      else if (do_ecmd(fnum, ffname, sfname, NULL, lnum,
Karsten Hopp 4d38a5
! 		(P_HID(curbuf) ? ECMD_HIDE : 0) + (forceit ? ECMD_FORCEIT : 0)) == OK)
Karsten Hopp 4d38a5
  	retval = -1;	/* opened another file */
Karsten Hopp 4d38a5
      else
Karsten Hopp 4d38a5
  	retval = 1;	/* error encountered */
Karsten Hopp 4d38a5
--- 3052,3059 ----
Karsten Hopp 4d38a5
  	retval = 0;	/* it's in the same file */
Karsten Hopp 4d38a5
      }
Karsten Hopp 4d38a5
      else if (do_ecmd(fnum, ffname, sfname, NULL, lnum,
Karsten Hopp 4d38a5
! 		(P_HID(curbuf) ? ECMD_HIDE : 0) + (forceit ? ECMD_FORCEIT : 0),
Karsten Hopp 4d38a5
! 		curwin) == OK)
Karsten Hopp 4d38a5
  	retval = -1;	/* opened another file */
Karsten Hopp 4d38a5
      else
Karsten Hopp 4d38a5
  	retval = 1;	/* error encountered */
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 3085,3101 ****
Karsten Hopp 4d38a5
   *	 ECMD_OLDBUF: use existing buffer if it exists
Karsten Hopp 4d38a5
   *	ECMD_FORCEIT: ! used for Ex command
Karsten Hopp 4d38a5
   *	 ECMD_ADDBUF: don't edit, just add to buffer list
Karsten Hopp 4d38a5
   *
Karsten Hopp 4d38a5
   * return FAIL for failure, OK otherwise
Karsten Hopp 4d38a5
   */
Karsten Hopp 4d38a5
      int
Karsten Hopp 4d38a5
! do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
Karsten Hopp 4d38a5
      int		fnum;
Karsten Hopp 4d38a5
      char_u	*ffname;
Karsten Hopp 4d38a5
      char_u	*sfname;
Karsten Hopp 4d38a5
      exarg_T	*eap;			/* can be NULL! */
Karsten Hopp 4d38a5
      linenr_T	newlnum;
Karsten Hopp 4d38a5
      int		flags;
Karsten Hopp 4d38a5
  {
Karsten Hopp 4d38a5
      int		other_file;		/* TRUE if editing another file */
Karsten Hopp 4d38a5
      int		oldbuf;			/* TRUE if using existing buffer */
Karsten Hopp 4d38a5
--- 3086,3106 ----
Karsten Hopp 4d38a5
   *	 ECMD_OLDBUF: use existing buffer if it exists
Karsten Hopp 4d38a5
   *	ECMD_FORCEIT: ! used for Ex command
Karsten Hopp 4d38a5
   *	 ECMD_ADDBUF: don't edit, just add to buffer list
Karsten Hopp 4d38a5
+  *   oldwin: Should be "curwin" when editing a new buffer in the current
Karsten Hopp 4d38a5
+  *           window, NULL when splitting the window first.  When not NULL info
Karsten Hopp 4d38a5
+  *           of the previous buffer for "oldwin" is stored.
Karsten Hopp 4d38a5
   *
Karsten Hopp 4d38a5
   * return FAIL for failure, OK otherwise
Karsten Hopp 4d38a5
   */
Karsten Hopp 4d38a5
      int
Karsten Hopp 4d38a5
! do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
Karsten Hopp 4d38a5
      int		fnum;
Karsten Hopp 4d38a5
      char_u	*ffname;
Karsten Hopp 4d38a5
      char_u	*sfname;
Karsten Hopp 4d38a5
      exarg_T	*eap;			/* can be NULL! */
Karsten Hopp 4d38a5
      linenr_T	newlnum;
Karsten Hopp 4d38a5
      int		flags;
Karsten Hopp 4d38a5
+     win_T	*oldwin;
Karsten Hopp 4d38a5
  {
Karsten Hopp 4d38a5
      int		other_file;		/* TRUE if editing another file */
Karsten Hopp 4d38a5
      int		oldbuf;			/* TRUE if using existing buffer */
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 3267,3273 ****
Karsten Hopp 4d38a5
  	{
Karsten Hopp 4d38a5
  	    if (!cmdmod.keepalt)
Karsten Hopp 4d38a5
  		curwin->w_alt_fnum = curbuf->b_fnum;
Karsten Hopp 4d38a5
! 	    buflist_altfpos();
Karsten Hopp 4d38a5
  	}
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  	if (fnum)
Karsten Hopp 4d38a5
--- 3272,3279 ----
Karsten Hopp 4d38a5
  	{
Karsten Hopp 4d38a5
  	    if (!cmdmod.keepalt)
Karsten Hopp 4d38a5
  		curwin->w_alt_fnum = curbuf->b_fnum;
Karsten Hopp 4d38a5
! 	    if (oldwin != NULL)
Karsten Hopp 4d38a5
! 		buflist_altfpos(oldwin);
Karsten Hopp 4d38a5
  	}
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  	if (fnum)
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 3371,3377 ****
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  		/* close the link to the current buffer */
Karsten Hopp 4d38a5
  		u_sync(FALSE);
Karsten Hopp 4d38a5
! 		close_buffer(curwin, curbuf,
Karsten Hopp 4d38a5
  				      (flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD);
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  #ifdef FEAT_AUTOCMD
Karsten Hopp 4d38a5
--- 3377,3383 ----
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  		/* close the link to the current buffer */
Karsten Hopp 4d38a5
  		u_sync(FALSE);
Karsten Hopp 4d38a5
! 		close_buffer(oldwin, curbuf,
Karsten Hopp 4d38a5
  				      (flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD);
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  #ifdef FEAT_AUTOCMD
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 5609,5615 ****
Karsten Hopp 4d38a5
  	     */
Karsten Hopp 4d38a5
  	    alt_fnum = curbuf->b_fnum;
Karsten Hopp 4d38a5
  	    (void)do_ecmd(0, NULL, NULL, NULL, ECMD_LASTL,
Karsten Hopp 4d38a5
! 						   ECMD_HIDE + ECMD_SET_HELP);
Karsten Hopp 4d38a5
  	    if (!cmdmod.keepalt)
Karsten Hopp 4d38a5
  		curwin->w_alt_fnum = alt_fnum;
Karsten Hopp 4d38a5
  	    empty_fnum = curbuf->b_fnum;
Karsten Hopp 4d38a5
--- 5615,5627 ----
Karsten Hopp 4d38a5
  	     */
Karsten Hopp 4d38a5
  	    alt_fnum = curbuf->b_fnum;
Karsten Hopp 4d38a5
  	    (void)do_ecmd(0, NULL, NULL, NULL, ECMD_LASTL,
Karsten Hopp 4d38a5
! 			  ECMD_HIDE + ECMD_SET_HELP,
Karsten Hopp 4d38a5
! #ifdef FEAT_WINDOWS
Karsten Hopp 4d38a5
! 			  NULL  /* buffer is still open, don't store info */
Karsten Hopp 4d38a5
! #else
Karsten Hopp 4d38a5
! 			  curwin
Karsten Hopp 4d38a5
! #endif
Karsten Hopp 4d38a5
! 		    );
Karsten Hopp 4d38a5
  	    if (!cmdmod.keepalt)
Karsten Hopp 4d38a5
  		curwin->w_alt_fnum = alt_fnum;
Karsten Hopp 4d38a5
  	    empty_fnum = curbuf->b_fnum;
Karsten Hopp 4d38a5
*** ../vim-7.2.040/src/ex_cmds2.c	Sun Sep  7 15:49:45 2008
Karsten Hopp 4d38a5
--- src/ex_cmds2.c	Wed Nov 12 17:46:41 2008
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 2132,2139 ****
Karsten Hopp 4d38a5
  	 * argument index. */
Karsten Hopp 4d38a5
  	if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL,
Karsten Hopp 4d38a5
  		      eap, ECMD_LAST,
Karsten Hopp 4d38a5
! 		      (P_HID(curwin->w_buffer) ? ECMD_HIDE : 0) +
Karsten Hopp 4d38a5
! 				   (eap->forceit ? ECMD_FORCEIT : 0)) == FAIL)
Karsten Hopp 4d38a5
  	    curwin->w_arg_idx = old_arg_idx;
Karsten Hopp 4d38a5
  	/* like Vi: set the mark where the cursor is in the file. */
Karsten Hopp 4d38a5
  	else if (eap->cmdidx != CMD_argdo)
Karsten Hopp 4d38a5
--- 2132,2139 ----
Karsten Hopp 4d38a5
  	 * argument index. */
Karsten Hopp 4d38a5
  	if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL,
Karsten Hopp 4d38a5
  		      eap, ECMD_LAST,
Karsten Hopp 4d38a5
! 		      (P_HID(curwin->w_buffer) ? ECMD_HIDE : 0)
Karsten Hopp 4d38a5
! 			 + (eap->forceit ? ECMD_FORCEIT : 0), curwin) == FAIL)
Karsten Hopp 4d38a5
  	    curwin->w_arg_idx = old_arg_idx;
Karsten Hopp 4d38a5
  	/* like Vi: set the mark where the cursor is in the file. */
Karsten Hopp 4d38a5
  	else if (eap->cmdidx != CMD_argdo)
Karsten Hopp 4d38a5
*** ../vim-7.2.040/src/ex_docmd.c	Sun Nov  9 13:43:25 2008
Karsten Hopp 4d38a5
--- src/ex_docmd.c	Wed Nov 12 18:04:22 2008
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 7488,7494 ****
Karsten Hopp 4d38a5
  	/* ":new" or ":tabnew" without argument: edit an new empty buffer */
Karsten Hopp 4d38a5
  	setpcmark();
Karsten Hopp 4d38a5
  	(void)do_ecmd(0, NULL, NULL, eap, ECMD_ONE,
Karsten Hopp 4d38a5
! 			       ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0));
Karsten Hopp 4d38a5
      }
Karsten Hopp 4d38a5
      else if ((eap->cmdidx != CMD_split
Karsten Hopp 4d38a5
  #ifdef FEAT_VERTSPLIT
Karsten Hopp 4d38a5
--- 7488,7495 ----
Karsten Hopp 4d38a5
  	/* ":new" or ":tabnew" without argument: edit an new empty buffer */
Karsten Hopp 4d38a5
  	setpcmark();
Karsten Hopp 4d38a5
  	(void)do_ecmd(0, NULL, NULL, eap, ECMD_ONE,
Karsten Hopp 4d38a5
! 		      ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0),
Karsten Hopp 4d38a5
! 		      old_curwin == NULL ? curwin : NULL);
Karsten Hopp 4d38a5
      }
Karsten Hopp 4d38a5
      else if ((eap->cmdidx != CMD_split
Karsten Hopp 4d38a5
  #ifdef FEAT_VERTSPLIT
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 7525,7531 ****
Karsten Hopp 4d38a5
  #ifdef FEAT_LISTCMDS
Karsten Hopp 4d38a5
  		    + (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0 )
Karsten Hopp 4d38a5
  #endif
Karsten Hopp 4d38a5
! 		    ) == FAIL)
Karsten Hopp 4d38a5
  	{
Karsten Hopp 4d38a5
  	    /* Editing the file failed.  If the window was split, close it. */
Karsten Hopp 4d38a5
  #ifdef FEAT_WINDOWS
Karsten Hopp 4d38a5
--- 7526,7532 ----
Karsten Hopp 4d38a5
  #ifdef FEAT_LISTCMDS
Karsten Hopp 4d38a5
  		    + (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0 )
Karsten Hopp 4d38a5
  #endif
Karsten Hopp 4d38a5
! 		    , old_curwin == NULL ? curwin : NULL) == FAIL)
Karsten Hopp 4d38a5
  	{
Karsten Hopp 4d38a5
  	    /* Editing the file failed.  If the window was split, close it. */
Karsten Hopp 4d38a5
  #ifdef FEAT_WINDOWS
Karsten Hopp 4d38a5
*** ../vim-7.2.040/src/ex_getln.c	Sun Sep 14 14:41:44 2008
Karsten Hopp 4d38a5
--- src/ex_getln.c	Wed Nov 12 18:06:25 2008
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 6051,6057 ****
Karsten Hopp 4d38a5
  	cmdwin_type = '-';
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
      /* Create the command-line buffer empty. */
Karsten Hopp 4d38a5
!     (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE);
Karsten Hopp 4d38a5
      (void)setfname(curbuf, (char_u *)"[Command Line]", NULL, TRUE);
Karsten Hopp 4d38a5
      set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL);
Karsten Hopp 4d38a5
      set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
Karsten Hopp 4d38a5
--- 6051,6057 ----
Karsten Hopp 4d38a5
  	cmdwin_type = '-';
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
      /* Create the command-line buffer empty. */
Karsten Hopp 4d38a5
!     (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL);
Karsten Hopp 4d38a5
      (void)setfname(curbuf, (char_u *)"[Command Line]", NULL, TRUE);
Karsten Hopp 4d38a5
      set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL);
Karsten Hopp 4d38a5
      set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
Karsten Hopp 4d38a5
*** ../vim-7.2.040/src/if_sniff.c	Sat Aug  9 19:41:16 2008
Karsten Hopp 4d38a5
--- src/if_sniff.c	Wed Nov 12 17:48:46 2008
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 1114,1120 ****
Karsten Hopp 4d38a5
      char *fname;
Karsten Hopp 4d38a5
  {
Karsten Hopp 4d38a5
      ++no_wait_return;
Karsten Hopp 4d38a5
!     do_ecmd(0, (char_u *)fname, NULL, NULL, ECMD_ONE, ECMD_HIDE+ECMD_OLDBUF);
Karsten Hopp 4d38a5
      curbuf->b_sniff = TRUE;
Karsten Hopp 4d38a5
      --no_wait_return;					/* [ex_docmd.c] */
Karsten Hopp 4d38a5
  }
Karsten Hopp 4d38a5
--- 1114,1121 ----
Karsten Hopp 4d38a5
      char *fname;
Karsten Hopp 4d38a5
  {
Karsten Hopp 4d38a5
      ++no_wait_return;
Karsten Hopp 4d38a5
!     do_ecmd(0, (char_u *)fname, NULL, NULL, ECMD_ONE, ECMD_HIDE+ECMD_OLDBUF,
Karsten Hopp 4d38a5
! 	    curwin);
Karsten Hopp 4d38a5
      curbuf->b_sniff = TRUE;
Karsten Hopp 4d38a5
      --no_wait_return;					/* [ex_docmd.c] */
Karsten Hopp 4d38a5
  }
Karsten Hopp 4d38a5
*** ../vim-7.2.040/src/main.c	Sun Nov  9 13:43:25 2008
Karsten Hopp 4d38a5
--- src/main.c	Wed Nov 12 17:49:06 2008
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 2588,2594 ****
Karsten Hopp 4d38a5
  # endif
Karsten Hopp 4d38a5
  	    (void)do_ecmd(0, arg_idx < GARGCOUNT
Karsten Hopp 4d38a5
  			  ? alist_name(&GARGLIST[arg_idx]) : NULL,
Karsten Hopp 4d38a5
! 			  NULL, NULL, ECMD_LASTL, ECMD_HIDE);
Karsten Hopp 4d38a5
  # ifdef HAS_SWAP_EXISTS_ACTION
Karsten Hopp 4d38a5
  	    if (swap_exists_did_quit)
Karsten Hopp 4d38a5
  	    {
Karsten Hopp 4d38a5
--- 2588,2594 ----
Karsten Hopp 4d38a5
  # endif
Karsten Hopp 4d38a5
  	    (void)do_ecmd(0, arg_idx < GARGCOUNT
Karsten Hopp 4d38a5
  			  ? alist_name(&GARGLIST[arg_idx]) : NULL,
Karsten Hopp 4d38a5
! 			  NULL, NULL, ECMD_LASTL, ECMD_HIDE, curwin);
Karsten Hopp 4d38a5
  # ifdef HAS_SWAP_EXISTS_ACTION
Karsten Hopp 4d38a5
  	    if (swap_exists_did_quit)
Karsten Hopp 4d38a5
  	    {
Karsten Hopp 4d38a5
*** ../vim-7.2.040/src/netbeans.c	Sun Jul 13 19:18:03 2008
Karsten Hopp 4d38a5
--- src/netbeans.c	Wed Nov 12 17:49:40 2008
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 1795,1801 ****
Karsten Hopp 4d38a5
  	    buf->displayname = NULL;
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  	    netbeansReadFile = 0; /* don't try to open disk file */
Karsten Hopp 4d38a5
! 	    do_ecmd(0, NULL, 0, 0, ECMD_ONE, ECMD_HIDE + ECMD_OLDBUF);
Karsten Hopp 4d38a5
  	    netbeansReadFile = 1;
Karsten Hopp 4d38a5
  	    buf->bufp = curbuf;
Karsten Hopp 4d38a5
  	    maketitle();
Karsten Hopp 4d38a5
--- 1795,1801 ----
Karsten Hopp 4d38a5
  	    buf->displayname = NULL;
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  	    netbeansReadFile = 0; /* don't try to open disk file */
Karsten Hopp 4d38a5
! 	    do_ecmd(0, NULL, 0, 0, ECMD_ONE, ECMD_HIDE + ECMD_OLDBUF, curwin);
Karsten Hopp 4d38a5
  	    netbeansReadFile = 1;
Karsten Hopp 4d38a5
  	    buf->bufp = curbuf;
Karsten Hopp 4d38a5
  	    maketitle();
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 1960,1966 ****
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  	    netbeansReadFile = 0; /* don't try to open disk file */
Karsten Hopp 4d38a5
  	    do_ecmd(0, (char_u *)buf->displayname, 0, 0, ECMD_ONE,
Karsten Hopp 4d38a5
! 						     ECMD_HIDE + ECMD_OLDBUF);
Karsten Hopp 4d38a5
  	    netbeansReadFile = 1;
Karsten Hopp 4d38a5
  	    buf->bufp = curbuf;
Karsten Hopp 4d38a5
  	    maketitle();
Karsten Hopp 4d38a5
--- 1960,1966 ----
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  	    netbeansReadFile = 0; /* don't try to open disk file */
Karsten Hopp 4d38a5
  	    do_ecmd(0, (char_u *)buf->displayname, 0, 0, ECMD_ONE,
Karsten Hopp 4d38a5
! 					     ECMD_HIDE + ECMD_OLDBUF, curwin);
Karsten Hopp 4d38a5
  	    netbeansReadFile = 1;
Karsten Hopp 4d38a5
  	    buf->bufp = curbuf;
Karsten Hopp 4d38a5
  	    maketitle();
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 1979,1985 ****
Karsten Hopp 4d38a5
  	    vim_free(buf->displayname);
Karsten Hopp 4d38a5
  	    buf->displayname = nb_unquote(args, NULL);
Karsten Hopp 4d38a5
  	    do_ecmd(0, (char_u *)buf->displayname, NULL, NULL, ECMD_ONE,
Karsten Hopp 4d38a5
! 						     ECMD_HIDE + ECMD_OLDBUF);
Karsten Hopp 4d38a5
  	    buf->bufp = curbuf;
Karsten Hopp 4d38a5
  	    buf->initDone = TRUE;
Karsten Hopp 4d38a5
  	    doupdate = 1;
Karsten Hopp 4d38a5
--- 1979,1985 ----
Karsten Hopp 4d38a5
  	    vim_free(buf->displayname);
Karsten Hopp 4d38a5
  	    buf->displayname = nb_unquote(args, NULL);
Karsten Hopp 4d38a5
  	    do_ecmd(0, (char_u *)buf->displayname, NULL, NULL, ECMD_ONE,
Karsten Hopp 4d38a5
! 					     ECMD_HIDE + ECMD_OLDBUF, curwin);
Karsten Hopp 4d38a5
  	    buf->bufp = curbuf;
Karsten Hopp 4d38a5
  	    buf->initDone = TRUE;
Karsten Hopp 4d38a5
  	    doupdate = 1;
Karsten Hopp 4d38a5
*** ../vim-7.2.040/src/normal.c	Sat Nov  1 13:51:57 2008
Karsten Hopp 4d38a5
--- src/normal.c	Wed Nov 12 17:49:50 2008
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 6050,6056 ****
Karsten Hopp 4d38a5
  	    autowrite(curbuf, FALSE);
Karsten Hopp 4d38a5
  	setpcmark();
Karsten Hopp 4d38a5
  	(void)do_ecmd(0, ptr, NULL, NULL, ECMD_LAST,
Karsten Hopp 4d38a5
! 					       P_HID(curbuf) ? ECMD_HIDE : 0);
Karsten Hopp 4d38a5
  	if (cap->nchar == 'F' && lnum >= 0)
Karsten Hopp 4d38a5
  	{
Karsten Hopp 4d38a5
  	    curwin->w_cursor.lnum = lnum;
Karsten Hopp 4d38a5
--- 6050,6056 ----
Karsten Hopp 4d38a5
  	    autowrite(curbuf, FALSE);
Karsten Hopp 4d38a5
  	setpcmark();
Karsten Hopp 4d38a5
  	(void)do_ecmd(0, ptr, NULL, NULL, ECMD_LAST,
Karsten Hopp 4d38a5
! 				       P_HID(curbuf) ? ECMD_HIDE : 0, curwin);
Karsten Hopp 4d38a5
  	if (cap->nchar == 'F' && lnum >= 0)
Karsten Hopp 4d38a5
  	{
Karsten Hopp 4d38a5
  	    curwin->w_cursor.lnum = lnum;
Karsten Hopp 4d38a5
*** ../vim-7.2.040/src/popupmnu.c	Sun Jul 13 19:33:51 2008
Karsten Hopp 4d38a5
--- src/popupmnu.c	Wed Nov 12 18:08:07 2008
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 573,579 ****
Karsten Hopp 4d38a5
  		{
Karsten Hopp 4d38a5
  		    /* Don't want to sync undo in the current buffer. */
Karsten Hopp 4d38a5
  		    ++no_u_sync;
Karsten Hopp 4d38a5
! 		    res = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, 0);
Karsten Hopp 4d38a5
  		    --no_u_sync;
Karsten Hopp 4d38a5
  		    if (res == OK)
Karsten Hopp 4d38a5
  		    {
Karsten Hopp 4d38a5
--- 573,579 ----
Karsten Hopp 4d38a5
  		{
Karsten Hopp 4d38a5
  		    /* Don't want to sync undo in the current buffer. */
Karsten Hopp 4d38a5
  		    ++no_u_sync;
Karsten Hopp 4d38a5
! 		    res = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, 0, NULL);
Karsten Hopp 4d38a5
  		    --no_u_sync;
Karsten Hopp 4d38a5
  		    if (res == OK)
Karsten Hopp 4d38a5
  		    {
Karsten Hopp 4d38a5
*** ../vim-7.2.040/src/proto/buffer.pro	Sun May  6 13:57:53 2007
Karsten Hopp 4d38a5
--- src/proto/buffer.pro	Wed Nov 12 17:43:39 2008
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 33,39 ****
Karsten Hopp 4d38a5
  char_u *getaltfname __ARGS((int errmsg));
Karsten Hopp 4d38a5
  int buflist_add __ARGS((char_u *fname, int flags));
Karsten Hopp 4d38a5
  void buflist_slash_adjust __ARGS((void));
Karsten Hopp 4d38a5
! void buflist_altfpos __ARGS((void));
Karsten Hopp 4d38a5
  int otherfile __ARGS((char_u *ffname));
Karsten Hopp 4d38a5
  void buf_setino __ARGS((buf_T *buf));
Karsten Hopp 4d38a5
  void fileinfo __ARGS((int fullname, int shorthelp, int dont_truncate));
Karsten Hopp 4d38a5
--- 33,39 ----
Karsten Hopp 4d38a5
  char_u *getaltfname __ARGS((int errmsg));
Karsten Hopp 4d38a5
  int buflist_add __ARGS((char_u *fname, int flags));
Karsten Hopp 4d38a5
  void buflist_slash_adjust __ARGS((void));
Karsten Hopp 4d38a5
! void buflist_altfpos __ARGS((win_T *win));
Karsten Hopp 4d38a5
  int otherfile __ARGS((char_u *ffname));
Karsten Hopp 4d38a5
  void buf_setino __ARGS((buf_T *buf));
Karsten Hopp 4d38a5
  void fileinfo __ARGS((int fullname, int shorthelp, int dont_truncate));
Karsten Hopp 4d38a5
*** ../vim-7.2.040/src/proto/ex_cmds.pro	Sun Nov  9 13:43:25 2008
Karsten Hopp 4d38a5
--- src/proto/ex_cmds.pro	Wed Nov 12 17:44:27 2008
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 27,33 ****
Karsten Hopp 4d38a5
  void do_wqall __ARGS((exarg_T *eap));
Karsten Hopp 4d38a5
  int not_writing __ARGS((void));
Karsten Hopp 4d38a5
  int getfile __ARGS((int fnum, char_u *ffname, char_u *sfname, int setpm, linenr_T lnum, int forceit));
Karsten Hopp 4d38a5
! int do_ecmd __ARGS((int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T newlnum, int flags));
Karsten Hopp 4d38a5
  void ex_append __ARGS((exarg_T *eap));
Karsten Hopp 4d38a5
  void ex_change __ARGS((exarg_T *eap));
Karsten Hopp 4d38a5
  void ex_z __ARGS((exarg_T *eap));
Karsten Hopp 4d38a5
--- 27,33 ----
Karsten Hopp 4d38a5
  void do_wqall __ARGS((exarg_T *eap));
Karsten Hopp 4d38a5
  int not_writing __ARGS((void));
Karsten Hopp 4d38a5
  int getfile __ARGS((int fnum, char_u *ffname, char_u *sfname, int setpm, linenr_T lnum, int forceit));
Karsten Hopp 4d38a5
! int do_ecmd __ARGS((int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T newlnum, int flags, win_T *oldwin));
Karsten Hopp 4d38a5
  void ex_append __ARGS((exarg_T *eap));
Karsten Hopp 4d38a5
  void ex_change __ARGS((exarg_T *eap));
Karsten Hopp 4d38a5
  void ex_z __ARGS((exarg_T *eap));
Karsten Hopp 4d38a5
*** ../vim-7.2.040/src/quickfix.c	Thu Jul 24 18:44:59 2008
Karsten Hopp 4d38a5
--- src/quickfix.c	Wed Nov 12 18:12:00 2008
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 1420,1425 ****
Karsten Hopp 4d38a5
--- 1420,1426 ----
Karsten Hopp 4d38a5
      win_T		*win;
Karsten Hopp 4d38a5
      win_T		*altwin;
Karsten Hopp 4d38a5
  #endif
Karsten Hopp 4d38a5
+     win_T		*oldwin = curwin;
Karsten Hopp 4d38a5
      int			print_message = TRUE;
Karsten Hopp 4d38a5
      int			len;
Karsten Hopp 4d38a5
  #ifdef FEAT_FOLDING
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 1744,1750 ****
Karsten Hopp 4d38a5
  	    }
Karsten Hopp 4d38a5
  	    else
Karsten Hopp 4d38a5
  		ok = do_ecmd(qf_ptr->qf_fnum, NULL, NULL, NULL, (linenr_T)1,
Karsten Hopp 4d38a5
! 						   ECMD_HIDE + ECMD_SET_HELP);
Karsten Hopp 4d38a5
  	}
Karsten Hopp 4d38a5
  	else
Karsten Hopp 4d38a5
  	    ok = buflist_getfile(qf_ptr->qf_fnum,
Karsten Hopp 4d38a5
--- 1745,1752 ----
Karsten Hopp 4d38a5
  	    }
Karsten Hopp 4d38a5
  	    else
Karsten Hopp 4d38a5
  		ok = do_ecmd(qf_ptr->qf_fnum, NULL, NULL, NULL, (linenr_T)1,
Karsten Hopp 4d38a5
! 					   ECMD_HIDE + ECMD_SET_HELP,
Karsten Hopp 4d38a5
! 					   oldwin == curwin ? curwin : NULL);
Karsten Hopp 4d38a5
  	}
Karsten Hopp 4d38a5
  	else
Karsten Hopp 4d38a5
  	    ok = buflist_getfile(qf_ptr->qf_fnum,
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 2267,2272 ****
Karsten Hopp 4d38a5
--- 2269,2275 ----
Karsten Hopp 4d38a5
      win_T	*win;
Karsten Hopp 4d38a5
      tabpage_T	*prevtab = curtab;
Karsten Hopp 4d38a5
      buf_T	*qf_buf;
Karsten Hopp 4d38a5
+     win_T	*oldwin = curwin;
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
      if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow)
Karsten Hopp 4d38a5
      {
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 2326,2339 ****
Karsten Hopp 4d38a5
  	    win->w_llist->qf_refcount++;
Karsten Hopp 4d38a5
  	}
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
  	if (qf_buf != NULL)
Karsten Hopp 4d38a5
  	    /* Use the existing quickfix buffer */
Karsten Hopp 4d38a5
  	    (void)do_ecmd(qf_buf->b_fnum, NULL, NULL, NULL, ECMD_ONE,
Karsten Hopp 4d38a5
! 						     ECMD_HIDE + ECMD_OLDBUF);
Karsten Hopp 4d38a5
  	else
Karsten Hopp 4d38a5
  	{
Karsten Hopp 4d38a5
  	    /* Create a new quickfix buffer */
Karsten Hopp 4d38a5
! 	    (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE);
Karsten Hopp 4d38a5
  	    /* switch off 'swapfile' */
Karsten Hopp 4d38a5
  	    set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
Karsten Hopp 4d38a5
  	    set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix",
Karsten Hopp 4d38a5
--- 2329,2344 ----
Karsten Hopp 4d38a5
  	    win->w_llist->qf_refcount++;
Karsten Hopp 4d38a5
  	}
Karsten Hopp 4d38a5
  
Karsten Hopp 4d38a5
+ 	if (oldwin != curwin)
Karsten Hopp 4d38a5
+ 	    oldwin = NULL;  /* don't store info when in another window */
Karsten Hopp 4d38a5
  	if (qf_buf != NULL)
Karsten Hopp 4d38a5
  	    /* Use the existing quickfix buffer */
Karsten Hopp 4d38a5
  	    (void)do_ecmd(qf_buf->b_fnum, NULL, NULL, NULL, ECMD_ONE,
Karsten Hopp 4d38a5
! 					     ECMD_HIDE + ECMD_OLDBUF, oldwin);
Karsten Hopp 4d38a5
  	else
Karsten Hopp 4d38a5
  	{
Karsten Hopp 4d38a5
  	    /* Create a new quickfix buffer */
Karsten Hopp 4d38a5
! 	    (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, oldwin);
Karsten Hopp 4d38a5
  	    /* switch off 'swapfile' */
Karsten Hopp 4d38a5
  	    set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
Karsten Hopp 4d38a5
  	    set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix",
Karsten Hopp 4d38a5
*** ../vim-7.2.040/src/window.c	Wed Aug  6 18:32:11 2008
Karsten Hopp 4d38a5
--- src/window.c	Wed Nov 12 18:12:37 2008
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 531,537 ****
Karsten Hopp 4d38a5
  # ifdef FEAT_SCROLLBIND
Karsten Hopp 4d38a5
  			curwin->w_p_scb = FALSE;
Karsten Hopp 4d38a5
  # endif
Karsten Hopp 4d38a5
! 			(void)do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL, ECMD_HIDE);
Karsten Hopp 4d38a5
  			if (nchar == 'F' && lnum >= 0)
Karsten Hopp 4d38a5
  			{
Karsten Hopp 4d38a5
  			    curwin->w_cursor.lnum = lnum;
Karsten Hopp 4d38a5
--- 531,538 ----
Karsten Hopp 4d38a5
  # ifdef FEAT_SCROLLBIND
Karsten Hopp 4d38a5
  			curwin->w_p_scb = FALSE;
Karsten Hopp 4d38a5
  # endif
Karsten Hopp 4d38a5
! 			(void)do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL,
Karsten Hopp 4d38a5
! 							   ECMD_HIDE, NULL);
Karsten Hopp 4d38a5
  			if (nchar == 'F' && lnum >= 0)
Karsten Hopp 4d38a5
  			{
Karsten Hopp 4d38a5
  			    curwin->w_cursor.lnum = lnum;
Karsten Hopp 4d38a5
*** ../vim-7.2.040/src/version.c	Wed Nov 12 16:04:43 2008
Karsten Hopp 4d38a5
--- src/version.c	Wed Nov 12 16:54:35 2008
Karsten Hopp 4d38a5
***************
Karsten Hopp 4d38a5
*** 678,679 ****
Karsten Hopp 4d38a5
--- 678,681 ----
Karsten Hopp 4d38a5
  {   /* Add new patch number below this line */
Karsten Hopp 4d38a5
+ /**/
Karsten Hopp 4d38a5
+     41,
Karsten Hopp 4d38a5
  /**/
Karsten Hopp 4d38a5
Karsten Hopp 4d38a5
-- 
Karsten Hopp 4d38a5
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 4d38a5
260. Co-workers have to E-mail you about the fire alarm to get
Karsten Hopp 4d38a5
     you out of the building.
Karsten Hopp 4d38a5
Karsten Hopp 4d38a5
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 4d38a5
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 4d38a5
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 4d38a5
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///