-1

If you have multiple tabs, giving the :tabclose command "closes" the tab but does not delete it from the buffer list, so the tab still appears in the tab menu; however it is inaccessible. To fully remove the tab, one would have to provide the :bd command. I'm not sure what the purpose is of closing a tab without deleting it from the buffer-list. From what I can gather from the help document, tabpage.txt, is that you aren't even able to reopen the closed tab, although, I could very well be wrong on that. I am rather confused on the purpose of this command; It seems more efficient to just use :bd and not bother with :tabclose.

Kalcifer
  • 1,211
  • 12
  • 18

2 Answers2

1

:tabclose tries to close all windows on a tab. If it succeeds then the tab is also closed.

Buffer is neither tab nor window. :bdelete is neither :bunload nor :bwipeout. 1 2 3 4

Matt
  • 13,674
  • 1
  • 18
  • 27
1

If you have multiple tabs, giving the :tabclose command "closes" the tab but does not delete it from the buffer list, so the tab still appears in the tab menu; however it is inaccessible.

You are confusing tab pages, windows, and buffers.

:tabclose closes the tab page. This also closes the windows contained in that tab page but the only effect it has on the buffers displayed in those windows is to hide them.

What is remaining after :tabclose is the buffers that were displayed in the windows contained by the tab page you closed. Since the buffer list is global and not tied in any way to either tab pages or windows, this is perfectly normal and expected.

To fully remove the tab, one would have to provide the :bd command.

No. The tab page was fully removed after :tabclose. :bd only "deletes" buffers.

I'm not sure what the purpose is of closing a tab without deleting it from the buffer-list.

Your tab page is not in the buffer list so what you describe only makes sense if you confuse tab pages, windows, and buffers.

See this answer of mine for more background tab pages, windows, and buffers.

romainl
  • 186,200
  • 21
  • 280
  • 313