From 25a9d0ba955613c467943599a780d3005e5a1cdd Mon Sep 17 00:00:00 2001 From: sharpchen Date: Sun, 10 Nov 2024 00:46:01 +0800 Subject: [PATCH] fix(ft): handles mismatch between parser name and filetype --- lua/Comment/ft.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/Comment/ft.lua b/lua/Comment/ft.lua index 34afffa..9965802 100644 --- a/lua/Comment/ft.lua +++ b/lua/Comment/ft.lua @@ -248,6 +248,9 @@ end ---ft.get('ansible.yaml') -- { '#%s' } ---@usage ]] function ft.get(lang, ctype) + -- NOTE: Add conversion for those parser names doesn't match to filetype + lang = lang == 'c_sharp' and 'cs' or lang + lang = lang == 'powershell' and 'ps1' or lang local tuple = L[lang] if not tuple then return nil