Karsten Hopp 81c285
To: vim-dev@vim.org
Karsten Hopp 81c285
Subject: Patch 7.2.220
Karsten Hopp 81c285
Fcc: outbox
Karsten Hopp 81c285
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 81c285
Mime-Version: 1.0
Karsten Hopp 81c285
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 81c285
Content-Transfer-Encoding: 8bit
Karsten Hopp 81c285
------------
Karsten Hopp 81c285
Karsten Hopp 81c285
Patch 7.2.220 (after 7.2.215)
Karsten Hopp 81c285
Problem:    a BufEnter autocommand that changes directory causes problems.
Karsten Hopp 81c285
	    (Ajit Thakkar)
Karsten Hopp 81c285
Solution:   Disable autocommands when opening a hidden buffer in a window.
Karsten Hopp 81c285
Files:	    src/fileio.c
Karsten Hopp 81c285
Karsten Hopp 81c285
Karsten Hopp 81c285
*** ../vim-7.2.219/src/fileio.c	2009-06-24 17:31:27.000000000 +0200
Karsten Hopp 81c285
--- src/fileio.c	2009-07-01 17:02:46.000000000 +0200
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 8441,8453 ****
Karsten Hopp 81c285
  	win_init_empty(aucmd_win); /* set cursor and topline to safe values */
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  #ifdef FEAT_WINDOWS
Karsten Hopp 81c285
! 	/* Split the current window, put the aucmd_win in the upper half. */
Karsten Hopp 81c285
  	make_snapshot(SNAP_AUCMD_IDX);
Karsten Hopp 81c285
  	save_ea = p_ea;
Karsten Hopp 81c285
  	p_ea = FALSE;
Karsten Hopp 81c285
  	(void)win_split_ins(0, WSP_TOP, aucmd_win, 0);
Karsten Hopp 81c285
  	(void)win_comp_pos();   /* recompute window positions */
Karsten Hopp 81c285
  	p_ea = save_ea;
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  	curwin = aucmd_win;
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
--- 8441,8456 ----
Karsten Hopp 81c285
  	win_init_empty(aucmd_win); /* set cursor and topline to safe values */
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  #ifdef FEAT_WINDOWS
Karsten Hopp 81c285
! 	/* Split the current window, put the aucmd_win in the upper half.
Karsten Hopp 81c285
! 	 * We don't want the BufEnter or WinEnter autocommands. */
Karsten Hopp 81c285
! 	block_autocmds();
Karsten Hopp 81c285
  	make_snapshot(SNAP_AUCMD_IDX);
Karsten Hopp 81c285
  	save_ea = p_ea;
Karsten Hopp 81c285
  	p_ea = FALSE;
Karsten Hopp 81c285
  	(void)win_split_ins(0, WSP_TOP, aucmd_win, 0);
Karsten Hopp 81c285
  	(void)win_comp_pos();   /* recompute window positions */
Karsten Hopp 81c285
  	p_ea = save_ea;
Karsten Hopp 81c285
+ 	unblock_autocmds();
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  	curwin = aucmd_win;
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 8474,8480 ****
Karsten Hopp 81c285
  	--curbuf->b_nwindows;
Karsten Hopp 81c285
  #ifdef FEAT_WINDOWS
Karsten Hopp 81c285
  	/* Find "aucmd_win", it can't be closed, but it may be in another tab
Karsten Hopp 81c285
! 	 * page. */
Karsten Hopp 81c285
  	if (curwin != aucmd_win)
Karsten Hopp 81c285
  	{
Karsten Hopp 81c285
  	    tabpage_T	*tp;
Karsten Hopp 81c285
--- 8477,8484 ----
Karsten Hopp 81c285
  	--curbuf->b_nwindows;
Karsten Hopp 81c285
  #ifdef FEAT_WINDOWS
Karsten Hopp 81c285
  	/* Find "aucmd_win", it can't be closed, but it may be in another tab
Karsten Hopp 81c285
! 	 * page. Do not trigger autocommands here. */
Karsten Hopp 81c285
! 	block_autocmds();
Karsten Hopp 81c285
  	if (curwin != aucmd_win)
Karsten Hopp 81c285
  	{
Karsten Hopp 81c285
  	    tabpage_T	*tp;
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 8498,8503 ****
Karsten Hopp 81c285
--- 8502,8508 ----
Karsten Hopp 81c285
  	last_status(FALSE);	    /* may need to remove last status line */
Karsten Hopp 81c285
  	restore_snapshot(SNAP_AUCMD_IDX, FALSE);
Karsten Hopp 81c285
  	(void)win_comp_pos();   /* recompute window positions */
Karsten Hopp 81c285
+ 	unblock_autocmds();
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  	if (win_valid(aco->save_curwin))
Karsten Hopp 81c285
  	    curwin = aco->save_curwin;
Karsten Hopp 81c285
*** ../vim-7.2.219/src/version.c	2009-07-01 16:12:54.000000000 +0200
Karsten Hopp 81c285
--- src/version.c	2009-07-01 17:10:22.000000000 +0200
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 678,679 ****
Karsten Hopp 81c285
--- 678,681 ----
Karsten Hopp 81c285
  {   /* Add new patch number below this line */
Karsten Hopp 81c285
+ /**/
Karsten Hopp 81c285
+     220,
Karsten Hopp 81c285
  /**/
Karsten Hopp 81c285
Karsten Hopp 81c285
-- 
Karsten Hopp 81c285
Microsoft is to software what McDonalds is to gourmet cooking
Karsten Hopp 81c285
Karsten Hopp 81c285
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 81c285
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 81c285
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 81c285
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///