<Fix>Error occurs when bigfile_size == nil

This commit is contained in:
Horange 2024-07-10 16:46:59 +08:00
parent 11268d8ff1
commit d902707507

View file

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