From da6fb89d3c4e91f2fdbdecc7ae35dd287d7c5204 Mon Sep 17 00:00:00 2001 From: Lucas Parry Date: Thu, 26 Oct 2023 11:51:28 +1100 Subject: [PATCH] fix(util): pcall reference to deleted buffer See #1863 This does stop my error, but I'm not super familiar with the language or the APIs to know if it's remotely correct. --- lua/lazyvim/util/plugin.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index fdd76f1a..b2f41742 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -96,7 +96,7 @@ function M.lazy_file() data = event.data, buf = event.buf, }) - if vim.bo[event.buf].filetype then + if pcall(vim.bo[event.buf], "filetype") then Event.trigger({ event = "FileType", buf = event.buf,