On 11/13/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
All,
I am trying to keep track of the number of buffers in the buffer list.
I'm doing this with the following code:
autocmd BufAdd * let g:zbuflistcount += 1
autocmd BufDelete * let g:zbuflistcount -= 1
The problem is I found this to be very unreliable in some circumstances,
and I'm not sure why.
The most obvious one is "vim *.cs" where multiple files would be opened;
however, the "BufAdd" autocmd wouldn't run enough times.
One thing that I think could cause it, is problem/restriction of
nested autocommands. By default, nested autocommands are suppressed.
Thus if autocommand creates abufffer, then [nested] autotommands
will not be executed (unless plugin uses word 'nested' ).
I just use bufnr('$') in my statusline. Simple and fast approximation.
Yakov