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.
This commit is contained in:
Lucas Parry 2023-10-26 11:51:28 +11:00
parent 09eafc60ef
commit da6fb89d3c
No known key found for this signature in database

View file

@ -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,