File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11return function ()
2- --- @param threshold number @Use global strategy if nr of lines exceeds this value
3- local function init_strategy (threshold )
4- return function ()
5- -- Disable on very large files
6- local line_count = vim .api .nvim_buf_line_count (0 )
7- if line_count > 15000 then
8- return nil
9- end
10-
11- -- Disable on parser error
12- local errors = 200
13- vim .treesitter .get_parser ():for_each_tree (function (lt )
14- if lt :root ():has_error () and errors >= 0 then
15- errors = errors - 1
16- end
17- end )
18- if errors < 0 then
19- return nil
20- end
21-
22- return line_count > threshold and require (" rainbow-delimiters" ).strategy [" global" ]
23- or require (" rainbow-delimiters" ).strategy [" local" ]
24- end
25- end
2+ -- local strategy triggers vim.treesitter.is_in_node_range() which hits
3+ -- a nil node bug in nvim 0.12 injection parsing; use global only.
4+ local global = require (" rainbow-delimiters" ).strategy [" global" ]
265
276 vim .g .rainbow_delimiters = {
287 strategy = {
29- [" " ] = init_strategy ( 500 ) ,
30- c = init_strategy ( 300 ) ,
31- cpp = init_strategy ( 300 ) ,
32- lua = init_strategy ( 500 ) ,
33- vimdoc = init_strategy ( 300 ) ,
34- vim = init_strategy ( 300 ) ,
8+ [" " ] = global ,
9+ c = global ,
10+ cpp = global ,
11+ lua = global ,
12+ vimdoc = global ,
13+ vim = global ,
3514 },
3615 query = {
3716 [" " ] = " rainbow-delimiters" ,
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ return function()
7474 duration = { step = 20 , total = 300 },
7575 },
7676 scope = {
77- enabled = true ,
77+ enabled = false , -- nvim 0.12 injection parsing bug triggers via treesitter scope
7878 char = " ┃" ,
7979 underline = false ,
8080 },
@@ -127,7 +127,7 @@ return function()
127127 },
128128 },
129129 terminal = { enabled = true },
130- quickfile = { enabled = true },
130+ quickfile = { enabled = false }, -- nvim 0.12 injection parsing bug via highlighter
131131 picker = {
132132 enabled = true ,
133133 sources = {
Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ editor["nvim-treesitter/nvim-treesitter"] = {
152152 },
153153 {
154154 " nvim-treesitter/nvim-treesitter-context" ,
155+ enabled = false , -- nvim 0.12 injection parsing bug via parse(range, callback)
155156 config = require (" editor.ts-context" ),
156157 },
157158 {
You can’t perform that action at this time.
0 commit comments