moll / vim-bbye

Delete buffers and close files in Vim without closing your windows or messing up your layout. Like Bclose.vim, but rewritten and well maintained.
http://www.vim.org/scripts/script.php?script_id=4664
Other
648 stars 32 forks source link

E516: No buffers were deleted: bdelete #5

Closed QMonkey closed 6 years ago

QMonkey commented 8 years ago

When I use Bdelete command to delete fugitive's Glog buffer, the buffer is successfully deleted, but I get the error below.

Error detected while processing function <SNR>87_bdelete:
E516: No buffers were deleted: bdelete 6

The buffer number of Glog is 6..

moll commented 8 years ago

Thanks for reporting! I've seen this too. Should really investigate. :)

simonsmith commented 8 years ago

I presume this is related, but if I try to close a buffer from :Gblame I also see:

Error detected while processing function <SNR>48_bdelete:
line   45:
E516: No buffers were deleted: bdelete 7
Press ENTER or type command to continue

After pressing Enter the buffer closes as expected

samuelsimoes commented 6 years ago

The problem seems to happen when you try to close a buffer with:

setlocal bufhidden=delete

With this config, the buffer is deleted from the buffer list, but it continues "existing" and the bufexist function here: https://github.com/moll/vim-bbye/blob/903f5eb17f72ebf7b0b1524bbb792c0b36761af6/plugin/bbye.vim#L48 returns true, but the bdelete can't delete an already unlisted buffer, so, I guess that changing the bufexists to buflisted could fix this problem.

moll commented 6 years ago

Thank you all for your help! I've switched bufexists() to buflisted() to counter bufhidden=delete. I guess the plugins I tested originally all used bufhidden=wipe so I didn't think how deleting a deleted buffer would work. :)