fix: fallback to filetype for get_lang for treesitter highlighting (#2867)

This commit is contained in:
Sebastian Lyng Johansen
2024-01-18 11:43:26 +01:00
committed by GitHub
parent 43cabe5327
commit b4befa1c2f
2 changed files with 2 additions and 2 deletions

View File

@@ -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