59634Re: When do buffer variables become undefined?
- Jun 3, 2005Eric Arnold wrote:
> That's something to check out. I've got a lot of autocommands, and I'mI suppose that one case is if 'hidden' is set and you execute ":only".
> jumping between buffers a lot. I'm beginning to wonder if is has something
> to with the behaviour of
> BufHidden Just after a buffer has become hidden. That
> NOTE: When this autocommand is executed, the
> current buffer "%" may be different from the
> buffer being unloaded "<afile>".
> which is also true for bufunload, bufdelete, etc. I guess I need to
> understand exactly when 'current buffer "%" may be different' from
> what I'm expecting.
There may be other cases. The morality is that anything invoked by an
autocommand from BufHidden, BufUnload, BufDelete, etc., shouldn't rely
of what the current buffer is. (And remember: if at that point you
switch buffers back and forth, autocommands such as WinEnter or BufEnter
won't be triggered unless "nested".)
- << Previous post in topic