mirror of
https://github.com/neovim/neovim.git
synced 2026-04-06 07:38:31 +00:00
fix(treesitter): escape hyphen in lua pattern
Ref: https://github.com/neovim/neovim/pull/38140#discussion_r2897235978
(cherry picked from commit d8e03d5d5a)
This commit is contained in:
committed by
github-actions[bot]
parent
9b13ee041f
commit
e0ea90070a
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user