aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lua/nvim-treesitter/parsers.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 3025c1d4f..71ca152e0 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -767,8 +767,13 @@ local M = {
}
function M.ft_to_lang(ft)
- ft = vim.split(ft, ".", true)[1]
- return ft_to_parsername[ft] or ft
+ local result = ft_to_parsername[ft]
+ if result then
+ return result
+ else
+ ft = vim.split(ft, ".", true)[1]
+ return ft_to_parsername[ft] or ft
+ end
end
function M.available_parsers()