As title. I want to detect the case when there is only one split in the current tab.
1 Answer
Start with:
echo tabpagewinnr(tabpagenr(), '$')
tabpagenr()
gives you the number of the current tab page.
Use '$'
as the second param to tabpagewinnr()
and that function will return the number of windows contained in the specified tab page.
So you can test for single window (no splits) with something like:
if tabpagewinnr(tabpagenr(), '$') == 1
" do something
endif
-
-
I just asked another one as relating to my next step, could you help me too? Jan 4, 2022 at 9:04
-
I answered with the first thing that occurred to me. If I had more time I might find something that just uses function calls but I'm a little short on time right now.– B LayerJan 4, 2022 at 9:29