mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00: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:
		@@ -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[]
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user