06526c7
To: vim-dev@vim.org
06526c7
Subject: Patch 7.2.008
06526c7
Fcc: outbox
06526c7
From: Bram Moolenaar <Bram@moolenaar.net>
06526c7
Mime-Version: 1.0
06526c7
Content-Type: text/plain; charset=ISO-8859-1
06526c7
Content-Transfer-Encoding: 8bit
06526c7
------------
06526c7
06526c7
Patch 7.2.008
06526c7
Problem:    With a BufHidden autocommand that invokes ":bunload" the window
06526c7
	    count for a buffer can be wrong. (Bob Hiestand)
06526c7
Solution:   Don't call enter_buffer() when already in that buffer.
06526c7
Files:	    src/buffer.c
06526c7
06526c7
06526c7
*** ../vim-7.2.007/src/buffer.c	Wed Aug  6 18:32:40 2008
06526c7
--- src/buffer.c	Mon Sep  1 14:25:45 2008
06526c7
***************
06526c7
*** 1351,1361 ****
06526c7
  	}
06526c7
      }
06526c7
  #ifdef FEAT_AUTOCMD
06526c7
  # ifdef FEAT_EVAL
06526c7
!     /* An autocommand may have deleted buf or aborted the script processing! */
06526c7
!     if (buf_valid(buf) && !aborting())
06526c7
  # else
06526c7
!     if (buf_valid(buf))	    /* an autocommand may have deleted buf! */
06526c7
  # endif
06526c7
  #endif
06526c7
  	enter_buffer(buf);
06526c7
--- 1351,1362 ----
06526c7
  	}
06526c7
      }
06526c7
  #ifdef FEAT_AUTOCMD
06526c7
+     /* An autocommand may have deleted "buf", already entered it (e.g., when
06526c7
+      * it did ":bunload") or aborted the script processing! */
06526c7
  # ifdef FEAT_EVAL
06526c7
!     if (buf_valid(buf) && buf != curbuf && !aborting())
06526c7
  # else
06526c7
!     if (buf_valid(buf) && buf != curbuf)
06526c7
  # endif
06526c7
  #endif
06526c7
  	enter_buffer(buf);
06526c7
*** ../vim-7.2.007/src/version.c	Mon Sep  1 16:50:09 2008
06526c7
--- src/version.c	Mon Sep  1 17:31:28 2008
06526c7
***************
06526c7
*** 678,679 ****
06526c7
--- 678,681 ----
06526c7
  {   /* Add new patch number below this line */
06526c7
+ /**/
06526c7
+     8,
06526c7
  /**/
06526c7
06526c7
-- 
06526c7
If Pacman had affected us as kids we'd be running around in dark rooms,
06526c7
munching pills and listening to repetitive music.
06526c7
                       -- Marcus Brigstocke
06526c7
06526c7
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
06526c7
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
06526c7
\\\        download, build and distribute -- http://www.A-A-P.org        ///
06526c7
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///