diff --git a/lua/telescope/builtin/files.lua b/lua/telescope/builtin/files.lua index 096820a..c726f98 100644 --- a/lua/telescope/builtin/files.lua +++ b/lua/telescope/builtin/files.lua @@ -487,10 +487,11 @@ files.current_buffer_fuzzy_find = function(opts) if ts_ok then filetype = ts_parsers.ft_to_lang(filetype) end + local _, ts_configs = pcall(require, "nvim-treesitter.configs") local parser_ok, parser = pcall(vim.treesitter.get_parser, bufnr, filetype) local query_ok, query = pcall(vim.treesitter.get_query, filetype, "highlights") - if parser_ok and query_ok then + if ts_configs.is_enabled("highlight", filetype, bufnr) and parser_ok and query_ok then local root = parser:parse()[1]:root() local highlighter = vim.treesitter.highlighter.new(parser)