Maybe it could be achieved by using autocmd, like the code below.
vim.api.nvim_create_autocmd("User", {
pattern = "MiniFilesActionDelete",
callback = function(args)
local fname = args.data.from
local bufnr = vim.fn.bufnr(fname)
if bufnr > 0 then
-- delete the buffer
end
end,
})
I did consider adding this as it is more or less aligned with the functionality of renaming file of an opened buffer. But eventually opted out for these reasons:
Not deleting buffer is an extra protection from accidental removal of a file, which I personally was grateful for couple of times.
Adding it is a matter of creating custom autocommand like the outline you provided.
Contributing guidelines
Module(s)
mini.files
Description
Maybe it could be achieved by using autocmd, like the code below.