mirror of
https://github.com/neovim/neovim.git
synced 2026-03-31 04:42:03 +00:00
fix(treesitter): escape hyphen in lua pattern
Ref: https://github.com/neovim/neovim/pull/38140#discussion_r2897235978
This commit is contained in:
committed by
Christian Clason
parent
f1c82be1a1
commit
d8e03d5d5a
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user