From dcad3eea02ec5a15389e99bde1eb8cc20af7ad35 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 18 Mar 2024 22:53:28 +0100 Subject: [PATCH] Try all parts of a compound filetype --- lua/nvim-paredit/lang/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/nvim-paredit/lang/init.lua b/lua/nvim-paredit/lang/init.lua index 2b0c960..6b7a28a 100644 --- a/lua/nvim-paredit/lang/init.lua +++ b/lua/nvim-paredit/lang/init.lua @@ -15,7 +15,12 @@ local function keys(tbl) end function M.get_language_api() - return langs[vim.bo.filetype] + for l in string.gmatch(vim.bo.filetype, "[^.]+") do + if langs[l] ~= nil then + return langs[l] + end + end + return nil end function M.add_language_extension(filetype, api)