Skip to content

Commit

Permalink
fix open big file with too many tree-sitter too slow
Browse files Browse the repository at this point in the history
  • Loading branch information
Layton authored and HATTER-LONG committed Jul 16, 2023
1 parent e69937d commit 63c98e9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/modules/configs/editor/rainbow_delims.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
return function()
vim.g.rainbow_delimiters = {
strategy = {
[""] = require("rainbow-delimiters").strategy["local"],
[""] = function()
local ok, is_large_file = pcall(vim.api.nvim_buf_get_var, vim.fn.bufnr(), "bigfile_disable_treesitter")
if ok and is_large_file then
return nil
end
return require("rainbow-delimiters").strategy["global"]
end,
},
query = {
[""] = "rainbow-delimiters",
Expand Down

0 comments on commit 63c98e9

Please sign in to comment.