fix(treesitter): support subfiletypes in get_lang (#23605)

This commit is contained in:
Christian Clason 2023-05-13 13:29:11 +02:00 committed by GitHub
parent 1086016477
commit 32dc484ec9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,11 @@ function M.get_lang(filetype)
if filetype == '' then if filetype == '' then
return return
end end
if ft_to_lang[filetype] then
return ft_to_lang[filetype]
end
-- support subfiletypes like html.glimmer
filetype = vim.split(filetype, '.', { plain = true })[1]
return ft_to_lang[filetype] return ft_to_lang[filetype]
end end