fix(python): make venv-selector dap_enabled conditional on nvim-dap-python (#1529)

This commit is contained in:
Iordanis Petkakis 2023-09-30 18:51:47 +03:00 committed by GitHub
parent bd48536335
commit 7821c0e851
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,15 +61,19 @@ return {
{ {
"linux-cultist/venv-selector.nvim", "linux-cultist/venv-selector.nvim",
cmd = "VenvSelect", cmd = "VenvSelect",
opts = { opts = function(_, opts)
if require("lazyvim.util").has("nvim-dap-python") then
opts.dap_enabled = true
end
return vim.tbl_deep_extend("force", opts, {
name = { name = {
"venv", "venv",
".venv", ".venv",
"env", "env",
".env", ".env",
}, },
dap_enabled = true, -- Ensure that the venv selector affect PythonPath in nvim-dap as well! })
}, end,
keys = { { "<leader>cv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv" } }, keys = { { "<leader>cv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv" } },
}, },
} }