mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 12:45:17 -07:00
fix(treesitter): language.add
- only register parser if it exists
Fixes: #24531
This commit is contained in:
parent
eecddd2416
commit
a4743487b7
@ -82,9 +82,8 @@ function M.add(lang, opts)
|
||||
filetype = { filetype, { 'string', 'table' }, true },
|
||||
})
|
||||
|
||||
M.register(lang, filetype)
|
||||
|
||||
if vim._ts_has_language(lang) then
|
||||
M.register(lang, filetype)
|
||||
return
|
||||
end
|
||||
|
||||
@ -102,6 +101,7 @@ function M.add(lang, opts)
|
||||
end
|
||||
|
||||
vim._ts_add_language(path, lang, symbol_name)
|
||||
M.register(lang, filetype)
|
||||
end
|
||||
|
||||
--- @param x string|string[]
|
||||
|
Loading…
Reference in New Issue
Block a user