diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-lsp-installer/installers/pip3.lua | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lua/nvim-lsp-installer/installers/pip3.lua b/lua/nvim-lsp-installer/installers/pip3.lua index c8586eb3..b0eb4611 100644 --- a/lua/nvim-lsp-installer/installers/pip3.lua +++ b/lua/nvim-lsp-installer/installers/pip3.lua @@ -6,6 +6,7 @@ local platform = require "nvim-lsp-installer.platform" local process = require "nvim-lsp-installer.process" local settings = require "nvim-lsp-installer.settings" local context = require "nvim-lsp-installer.installers.context" +local log = require "nvim-lsp-installer.log" local M = {} @@ -48,9 +49,18 @@ end function M.packages(packages) local py3 = create_installer("python3", packages) local py = create_installer("python", packages) + -- see https://github.com/williamboman/nvim-lsp-installer/issues/128 + local installer_variants = platform.is_win and { py, py3 } or { py3, py } + + local py3_host_prog = vim.g.python3_host_prog + if py3_host_prog then + log.fmt_debug("Found python3_host_prog (%s)", py3_host_prog) + table.insert(installer_variants, 1, create_installer(py3_host_prog, packages)) + end + return installers.pipe { context.promote_install_dir(), - installers.first_successful(platform.is_win and { py, py3 } or { py3, py }), -- see https://github.com/williamboman/nvim-lsp-installer/issues/128 + installers.first_successful(installer_variants), } end |
