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)
name = { if require("lazyvim.util").has("nvim-dap-python") then
"venv", opts.dap_enabled = true
".venv", end
"env", return vim.tbl_deep_extend("force", opts, {
".env", name = {
}, "venv",
dap_enabled = true, -- Ensure that the venv selector affect PythonPath in nvim-dap as well! ".venv",
}, "env",
".env",
},
})
end,
keys = { { "<leader>cv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv" } }, keys = { { "<leader>cv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv" } },
}, },
} }