chore: ignore vim.loop.fs_stat undefined (from libuv)

This commit is contained in:
Youwen Wu 2024-12-30 14:43:38 -08:00
parent c631eab667
commit 993371fd20
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3

View file

@ -33,11 +33,6 @@ vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
vim.opt.scrolloff = 10
if os.getenv("TERM") == "xterm-kitty" then
require("scripts.chameleon").setup()
require("scripts.kitty-padding").setup()
end
vim.cmd.colorscheme("oxocarbon")
require("nvim-treesitter.configs").setup({
@ -49,6 +44,7 @@ require("nvim-treesitter.configs").setup({
highlight = { enable = true },
disable = function(_, buf)
local max_filesize = 100 * 1024 -- 100 KB
---@diagnostic disable-next-line: undefined-field
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true