File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -271,9 +271,19 @@ function Config:ts_highlights_enabled()
271271 end
272272 self .ts_hl_enabled = false
273273 local hl_module = require (' nvim-treesitter.configs' ).get_module (' highlight' )
274- if hl_module and hl_module . enable and not vim . tbl_contains ( hl_module .disable or {}, ' org ' ) then
275- self . ts_hl_enabled = true
274+ if not hl_module or not hl_module .enable then
275+ return false
276276 end
277+ if hl_module .disable then
278+ if type (hl_module .disable ) == ' function' and hl_module .disable (' org' , vim .api .nvim_get_current_buf ()) then
279+ return false
280+ end
281+
282+ if type (hl_module .disable ) == ' table' and vim .tbl_contains (hl_module .disable , ' org' ) then
283+ return false
284+ end
285+ end
286+ self .ts_hl_enabled = true
277287 return self .ts_hl_enabled
278288end
279289
You can’t perform that action at this time.
0 commit comments