Karsten Hopp 81c285
To: vim-dev@vim.org
Karsten Hopp 81c285
Subject: Patch 7.2.202
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.202
Karsten Hopp 81c285
Problem:    BufWipeout autocommand that edits another buffer causes problems.
Karsten Hopp 81c285
Solution:   Check for the situation, give an error and quit the operation.
Karsten Hopp 81c285
Files:	    src/fileio.c
Karsten Hopp 81c285
Karsten Hopp 81c285
Karsten Hopp 81c285
*** ../vim-7.2.201/src/fileio.c	2009-05-16 17:29:37.000000000 +0200
Karsten Hopp 81c285
--- src/fileio.c	2009-06-11 21:22:37.000000000 +0200
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 4824,4829 ****
Karsten Hopp 81c285
--- 4824,4831 ----
Karsten Hopp 81c285
      char_u	*sfname;
Karsten Hopp 81c285
  {
Karsten Hopp 81c285
  #ifdef FEAT_AUTOCMD
Karsten Hopp 81c285
+     buf_T	*buf = curbuf;
Karsten Hopp 81c285
+ 
Karsten Hopp 81c285
      /* It's like the unnamed buffer is deleted.... */
Karsten Hopp 81c285
      if (curbuf->b_p_bl)
Karsten Hopp 81c285
  	apply_autocmds(EVENT_BUFDELETE, NULL, NULL, FALSE, curbuf);
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 4832,4837 ****
Karsten Hopp 81c285
--- 4834,4845 ----
Karsten Hopp 81c285
      if (aborting())	    /* autocmds may abort script processing */
Karsten Hopp 81c285
  	return FAIL;
Karsten Hopp 81c285
  # endif
Karsten Hopp 81c285
+     if (curbuf != buf)
Karsten Hopp 81c285
+     {
Karsten Hopp 81c285
+ 	/* We are in another buffer now, don't do the renaming. */
Karsten Hopp 81c285
+ 	EMSG(_(e_auchangedbuf));
Karsten Hopp 81c285
+ 	return FAIL;
Karsten Hopp 81c285
+     }
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      if (setfname(curbuf, fname, sfname, FALSE) == OK)
Karsten Hopp 81c285
*** ../vim-7.2.201/src/version.c	2009-06-16 15:23:07.000000000 +0200
Karsten Hopp 81c285
--- src/version.c	2009-06-16 15:28:31.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
+     202,
Karsten Hopp 81c285
  /**/
Karsten Hopp 81c285
Karsten Hopp 81c285
-- 
Karsten Hopp 81c285
How To Keep A Healthy Level Of Insanity:
Karsten Hopp 81c285
14. Put mosquito netting around your work area. Play a tape of jungle
Karsten Hopp 81c285
    sounds all day.
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    ///