From d90270750796ce6553fe90f5f07ec72ce3127e95 Mon Sep 17 00:00:00 2001 From: Horange Date: Wed, 10 Jul 2024 16:46:59 +0800 Subject: [PATCH] Error occurs when bigfile_size == nil --- lua/lazyvim/config/autocmds.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index f9a83c82..a72fa96a 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -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,