diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index 4530bd97..ff4267fb 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -61,15 +61,19 @@ return { { "linux-cultist/venv-selector.nvim", cmd = "VenvSelect", - opts = { - name = { - "venv", - ".venv", - "env", - ".env", - }, - dap_enabled = true, -- Ensure that the venv selector affect PythonPath in nvim-dap as well! - }, + 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 = { + "venv", + ".venv", + "env", + ".env", + }, + }) + end, keys = { { "cv", ":VenvSelect", desc = "Select VirtualEnv" } }, }, }