fix(treesitter): escape hyphen in lua pattern

Ref: https://github.com/neovim/neovim/pull/38140#discussion_r2897235978
This commit is contained in:
Stefan VanBuren
2026-03-06 15:21:54 -05:00
committed by Christian Clason
parent f1c82be1a1
commit d8e03d5d5a

View File

@@ -1023,7 +1023,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