fix: Delete a file as an open buffer (#939)
This commit is contained in:
@@ -16,8 +16,8 @@ local function clear_buffer(absolute_path)
|
|||||||
vim.cmd(':bn')
|
vim.cmd(':bn')
|
||||||
a.nvim_set_current_win(winnr)
|
a.nvim_set_current_win(winnr)
|
||||||
end
|
end
|
||||||
vim.api.nvim_buf_delete(buf.bufnr, {})
|
vim.api.nvim_buf_delete(buf.bufnr, { force = true })
|
||||||
if buf.windows[1] then
|
if buf.windows[1] and vim.api.nvim_win_is_valid(buf.bufnr) then
|
||||||
vim.api.nvim_win_close(buf.windows[1], true)
|
vim.api.nvim_win_close(buf.windows[1], true)
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user