Loading ...
Sorry, an error occurred while loading the content.

59634Re: When do buffer variables become undefined?

Expand Messages
  • A. J. Mechelynck
    Jun 3, 2005
      Eric Arnold wrote:
      > That's something to check out. I've got a lot of autocommands, and I'm
      > 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.

      I suppose that one case is if 'hidden' is set and you execute ":only".
      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".)

      Best regards,
      Tony.
    • Show all 14 messages in this topic