fix(autocmds): check that buf exists

This commit is contained in:
Folke Lemaitre 2024-06-26 17:09:37 +02:00
parent 53f4595b4e
commit 135ce0d7ed
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -119,7 +119,11 @@ vim.filetype.add({
pattern = {
[".*"] = {
function(path, buf)
return vim.bo[buf].filetype ~= "bigfile" and path and vim.fn.getfsize(path) > vim.g.bigfile_size and "bigfile"
return vim.bo[buf]
and vim.bo[buf].filetype ~= "bigfile"
and path
and vim.fn.getfsize(path) > vim.g.bigfile_size
and "bigfile"
or nil
end,
},