fix: Set and unset report to what's needed when deleting buffers. (#282)
Fixes #105.
This commit is contained in:
@@ -141,9 +141,15 @@ end
|
||||
function utils.buf_delete(bufnr)
|
||||
if bufnr == nil then return end
|
||||
|
||||
-- Suppress the buffer deleted message for those with &report<2
|
||||
start_report = vim.o.report
|
||||
if start_report < 2 then vim.o.report = 2 end
|
||||
|
||||
if vim.api.nvim_buf_is_valid(bufnr) and vim.api.nvim_buf_is_loaded(bufnr) then
|
||||
vim.cmd(string.format("bdelete! %s", bufnr))
|
||||
end
|
||||
|
||||
if start_report < 2 then vim.o.report = start_report end
|
||||
end
|
||||
|
||||
function utils.max_split(s, pattern, maxsplit)
|
||||
|
||||
Reference in New Issue
Block a user