Prevents errors when non-normal buffer is only one remaining

This commit is contained in:
SL1900
2024-09-14 23:41:10 +09:00
parent dfba266639
commit 9f2cb8233b
+1 -1
View File
@@ -15,7 +15,7 @@ return {
write = function ()
for _, win_id in ipairs(vim.api.nvim_list_wins()) do
local buf_id = vim.api.nvim_win_get_buf(win_id)
if vim.bo[buf_id].buftype ~= '' then vim.api.nvim_win_close(win_id, true) end
if vim.bo[buf_id].buftype ~= '' then pcall( vim.api.nvim_win_close, win_id, true ) end
end
end
}