fix: current_buffer_fuzzy_find check if nvim-ts is okay before calling is_enabled

This commit is contained in:
Simon Hauser
2021-12-05 08:19:23 +01:00
parent 27294d73e4
commit 16b0188cf5

View File

@@ -491,7 +491,7 @@ files.current_buffer_fuzzy_find = function(opts)
local parser_ok, parser = pcall(vim.treesitter.get_parser, bufnr, filetype) local parser_ok, parser = pcall(vim.treesitter.get_parser, bufnr, filetype)
local query_ok, query = pcall(vim.treesitter.get_query, filetype, "highlights") local query_ok, query = pcall(vim.treesitter.get_query, filetype, "highlights")
if ts_configs.is_enabled("highlight", filetype, bufnr) and parser_ok and query_ok then if parser_ok and query_ok and ts_ok and ts_configs.is_enabled("highlight", filetype, bufnr) then
local root = parser:parse()[1]:root() local root = parser:parse()[1]:root()
local highlighter = vim.treesitter.highlighter.new(parser) local highlighter = vim.treesitter.highlighter.new(parser)