Fix treesitter
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user