fix(wipe): wipe all nvim-tree rogue buffers

also prevent find_file if bufnr is not valid
fixes #1438
This commit is contained in:
kiyan
2022-07-18 13:29:05 +02:00
parent 16753d5e25
commit ec530e73be
2 changed files with 4 additions and 1 deletions

View File

@@ -148,6 +148,9 @@ function M.find_file(with_open, bufnr, bang)
end
bufnr = bufnr or api.nvim_get_current_buf()
if not api.nvim_buf_is_valid(bufnr) then
return
end
local bufname = api.nvim_buf_get_name(bufnr)
local filepath = utils.canonical_path(vim.fn.fnamemodify(bufname, ":p"))
if not is_file_readable(filepath) then