Fix treesitter

This commit is contained in:
Christian Nieves
2024-01-04 22:47:51 +00:00
parent a8e22c563e
commit ece8d50bef
3 changed files with 14 additions and 3 deletions

View File

@ -57,9 +57,18 @@ return {
return true
end
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
local max_filesize = 100 * 1024 -- 200 KB
local fname = vim.api.nvim_buf_get_name(buf)
local ok, stats = pcall(vim.loop.fs_stat, fname)
if ok and stats and stats.size > max_filesize then
vim.schedule(function()
vim.notify(
string.format(
"Disabling treesitter. File %s exceeds maximum configured size.",
fname
)
)
end)
return true
end
end,