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