diff options
| author | Markus Koller <markus-koller@gmx.ch> | 2020-09-10 14:18:15 +0200 |
|---|---|---|
| committer | Thomas Vigouroux <tomvig38@gmail.com> | 2020-09-10 15:11:04 +0200 |
| commit | fd6d09fd1f52d0c7d307c7f10b95509400d859c9 (patch) | |
| tree | 95796ab99302a280b405876a0a819dc454b16a33 /lua/nvim-treesitter/install.lua | |
| parent | 10848ca5bd2893664eab122c9b415860e5352e79 (diff) | |
Find package path based on the Lua source file
This is more robust compared to the previous method where we walked
up the tree and matched on the directory name, which also required
that the repository was cloned in a directory named `nvim-treesitter`.
Diffstat (limited to 'lua/nvim-treesitter/install.lua')
| -rw-r--r-- | lua/nvim-treesitter/install.lua | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 3b75362c..61b1a9f9 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -200,9 +200,7 @@ local function install(with_sync, ask_reinstall) return api.nvim_err_writeln('Git is required on your system to run this command') end - local package_path, err = utils.get_package_path() - if err then return api.nvim_err_writeln(err) end - + local package_path = utils.get_package_path() local cache_folder, err = utils.get_cache_dir() if err then return api.nvim_err_writeln(err) end @@ -267,11 +265,7 @@ function M.uninstall(lang) M.uninstall(lang) end elseif lang then - local package_path, err = utils.get_package_path() - if err then - print(err) - return - end + local package_path = utils.get_package_path() local parser_lib = package_path..path_sep.."parser"..path_sep..lang..".so" local command_list = { |
