Saturday, July 30, 2011

Re: Function/variable containing the number of current buffers

On 29/07/11 12:35, Axel Bender wrote:
> Is there any function/variable returning the number of open (non-hidden)
> buffers in GVim?

Not out of the box, I think, but you could certainly build one by means
of two nested while loops, with the help of the following functions (q.v.):

winnr()
tabpagenr()
tabpagewinnr()
winbufnr()

Adding tabpagewinnr(t, '$') for all t such that 1 <= t <= tabpagenr('$')
could give too high a value, because a single buffer may be displayed in
more than one window of one or more tabpages.


Best regards,
Tony.
--
Just remember: when you go to court, you are trusting your fate to
twelve people that weren't smart enough to get out of jury duty!

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment