fix: fallback to filetype for get_lang for treesitter highlighting (#2867)
This commit is contained in:
committed by
GitHub
parent
43cabe5327
commit
b4befa1c2f
@@ -167,7 +167,7 @@ end
|
||||
-- Attach ts highlighter
|
||||
utils.ts_highlighter = function(bufnr, ft)
|
||||
if has_filetype(ft) then
|
||||
local lang = vim.treesitter.language.get_lang(ft)
|
||||
local lang = vim.treesitter.language.get_lang(ft) or ft
|
||||
if lang and ts_utils.has_ts_parser(lang) then
|
||||
return vim.treesitter.start(bufnr, lang)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user