fix: remove buffer when its empty when hijacking
This commit is contained in:
@@ -302,6 +302,11 @@ function M.open_on_directory()
|
|||||||
local buf = api.nvim_get_current_buf()
|
local buf = api.nvim_get_current_buf()
|
||||||
local bufname = api.nvim_buf_get_name(buf)
|
local bufname = api.nvim_buf_get_name(buf)
|
||||||
if vim.fn.isdirectory(bufname) ~= 1 then
|
if vim.fn.isdirectory(bufname) ~= 1 then
|
||||||
|
if bufname == "" then
|
||||||
|
vim.schedule(function()
|
||||||
|
vim.api.nvim_buf_delete(buf, { force = true })
|
||||||
|
end)
|
||||||
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user