mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(treesitter): don't return error message on success #31955
Problem: The `vim.treesitter.language.add` function returns a error message even when it succeeds. Solution: Don't return error message on success.
This commit is contained in:
parent
37c77ab46b
commit
aa2b44fbb0
@ -133,8 +133,9 @@ function M.add(lang, opts)
|
||||
path = paths[1]
|
||||
end
|
||||
|
||||
return loadparser(path, lang, symbol_name) or nil,
|
||||
string.format('Cannot load parser %s for language "%s"', path, lang)
|
||||
local res = loadparser(path, lang, symbol_name)
|
||||
return res,
|
||||
res == nil and string.format('Cannot load parser %s for language "%s"', path, lang) or nil
|
||||
end
|
||||
|
||||
--- @param x string|string[]
|
||||
|
Loading…
Reference in New Issue
Block a user