<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 = { pattern = {
[".*"] = { [".*"] = {
function(path, buf) function(path, buf)
local bfs = vim.g.bigfile_size
return vim.bo[buf] return vim.bo[buf]
and vim.bo[buf].filetype ~= "bigfile" and vim.bo[buf].filetype ~= "bigfile"
and path and path
and vim.fn.getfsize(path) > vim.g.bigfile_size and (bfs and vim.fn.getfsize(path) > bfs or true)
and "bigfile" and "bigfile"
or nil or nil
end, end,