blob: 4acb202b5f206823e37b15f798091173ef1732fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
local api = vim.api
local queries = require'nvim-treesitter.query'
local ts = vim.treesitter
local M = {}
function M.setup(bufnr, ft)
local buf = bufnr or api.nvim_get_current_buf()
local ft = ft or api.nvim_buf_get_option(buf, 'ft')
local query = queries.get_query(ft, "highlights")
if not query then return end
ts.TSHighlighter.new(query, buf, ft)
end
return M
|