From 135ce0d7edb64958b2c8f636a9ba624ec0721eb3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 26 Jun 2024 17:09:37 +0200 Subject: [PATCH] fix(autocmds): check that buf exists --- lua/lazyvim/config/autocmds.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index cf013e1f..58f43f0b 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -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, },