Skip to content

Commit

Permalink
Try all parts of a compound filetype
Browse files Browse the repository at this point in the history
  • Loading branch information
taw10 committed Mar 18, 2024
1 parent 54e4265 commit dcad3ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/nvim-paredit/lang/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dcad3ee

Please sign in to comment.