Closed jdrouhard closed 3 years ago
Is the issue fixed for you now?
Yes, thank you so much!
This issue seems to have resurfaced.
If you use the previous commit, does it work as intended?
If you use the previous commit, does it work as intended?
Yes. It seems to be the most recent commit that regressed this behavior.
@spindensity any thoughts?
So it looks like if the buffer has bufhidden=delete
then nvim_buf_is_valid(bufnr)
returns true even after the buffer is deleted. The check on https://github.com/famiu/bufdelete.nvim/blob/master/lua/bufdelete/init.lua#L61 might need to also check that the buffer is listed as well, like:
if api.nvim_buf_is_valid(bufnr) and bo[bufnr].buflisted then
cmd(string.format('%s %d', kill_command, bufnr))
end
I tested this and it does fix the issue.
I pushed a change that incorporates that. If your issue is fixed now, please close this
Yep, that did the trick. Thanks again!
If there are at least two buffers open, and the last buffer has
bufhidden=wipe
set on it, then usingBdelete
errors with the following:I could only make this happen if there are at least two normal buffers open and the buffer with the
wipe
option set on it is the last one. Minimal repro is basically to open three buffers, then (when on the last/most recent),set bufhidden=wipe
andBdelete
.