diff options
Diffstat (limited to 'lua/aotrix/plugins/treesitter.lua')
| -rw-r--r-- | lua/aotrix/plugins/treesitter.lua | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lua/aotrix/plugins/treesitter.lua b/lua/aotrix/plugins/treesitter.lua index 09dc61c..7891b2c 100644 --- a/lua/aotrix/plugins/treesitter.lua +++ b/lua/aotrix/plugins/treesitter.lua @@ -26,15 +26,14 @@ return { -- the name of the parser) -- list of language that will be disabled -- disable = { "c", "rust" }, - disable = { "cpp" }, -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files - -- disable = function(lang, buf) - -- local max_filesize = 100 * 1024 -- 100 KB - -- 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 - -- end - -- end, + disable = function(lang, buf) + local max_filesize = 100 * 1024 -- 100 KB + 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 + end + end, -- Setting this to true will run `:h syntax` and tree-sitter at the same time. -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). |
