mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 11:36:54 -04:00
Refactor: Add parsers.get_buf_lang
This commit is contained in:
parent
1849f30bb5
commit
a4e2692c7b
5 changed files with 18 additions and 11 deletions
|
|
@ -54,7 +54,7 @@ hlmap["include"] = "TSInclude"
|
|||
|
||||
function M.attach(bufnr, lang)
|
||||
local bufnr = bufnr or api.nvim_get_current_buf()
|
||||
local lang = lang or parsers.ft_to_lang(api.nvim_buf_get_option(bufnr, 'ft'))
|
||||
local lang = parsers.get_buf_lang(bufnr, lang)
|
||||
local config = configs.get_module('highlight')
|
||||
|
||||
for k, v in pairs(config.custom_captures) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue