diff --git a/runtime/lua/vim/treesitter/languagetree.lua b/runtime/lua/vim/treesitter/languagetree.lua index a2f9371ff1..34c9a2d337 100644 --- a/runtime/lua/vim/treesitter/languagetree.lua +++ b/runtime/lua/vim/treesitter/languagetree.lua @@ -915,7 +915,7 @@ end) ---@return string? # resolved parser name local function resolve_lang(alias) -- normalize: treesitter language names are always lower case and use underscores - alias = alias and alias:lower():gsub('-', '_') + alias = alias and alias:lower():gsub('%-', '_') -- validate that `alias` is a legal language if not (alias and alias:match('[%w_]+') == alias) then return