fix: dap python

This commit is contained in:
asep.komarudin 2024-06-22 13:56:20 +07:00
parent fa07b44ecf
commit 5817798c72
2 changed files with 54 additions and 52 deletions

View file

@ -1,10 +1,7 @@
local M = {}
if pcode.active_python_config then
M = {
{
local nvim_dap = {
"mfussenegger/nvim-dap",
event = "BufReadPre",
enabled = vim.fn.has("win32") == 1,
dependencies = {
"rcarriga/nvim-dap-ui",
"theHamsta/nvim-dap-virtual-text",
@ -51,7 +48,9 @@ if pcode.active_python_config then
{ "<leader>dq", "<cmd>lua require'dap'.close()<cr>", desc = "Quit" },
{ "<leader>dU", "<cmd>lua require'dapui'.toggle({reset = true})<cr>", desc = "Toggle UI" },
},
},
}
if pcode.active_python_config then
M = {
-- https://github.com/nvim-neotest/neotest-python
-- https://docs.pytest.org/en/7.1.x/getting-started.html
{
@ -92,5 +91,8 @@ if pcode.active_python_config then
},
},
}
if vim.fn.has("win32") ~= 0 then
table.insert(M, nvim_dap)
end
end
return M

View file

@ -70,7 +70,7 @@ if pcode.active_python_config then
table.insert(pcode.mason_ensure_installed, "pyright")
table.insert(pcode.null_ls_ensure_installed, "flake8")
table.insert(pcode.null_ls_ensure_installed, "black")
if vim.fn.has("win32") == 0 then
if vim.fn.has("win32") ~= 1 then
pcode.nvim_dap = true
end
end