Closed jaghaimo closed 1 year ago
Afraid I can't reproduce. Can you create a minimal init.lua?
Here's a starter one nvim --clean -u min.lua
-- ignore default config and plugins
vim.opt.runtimepath:remove(vim.fn.stdpath("config"))
vim.opt.packpath:remove(vim.fn.stdpath("data") .. "/site")
vim.opt.termguicolors = true
vim.opt.laststatus = 0
-- append test directory
local test_dir = "/tmp/nvim-config"
vim.opt.runtimepath:append(vim.fn.expand(test_dir))
vim.opt.packpath:append(vim.fn.expand(test_dir))
-- install packer
local install_path = test_dir .. "/pack/packer/start/packer.nvim"
local install_plugins = false
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
vim.cmd("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
vim.cmd("packadd packer.nvim")
install_plugins = true
end
local packer = require("packer")
packer.init({
package_root = test_dir .. "/pack",
compile_path = test_dir .. "/plugin/packer_compiled.lua",
})
packer.startup(function(use)
-- Packer can manage itself
use("wbthomason/packer.nvim")
use({ "mfussenegger/nvim-dap" })
use({
"rcarriga/nvim-dap-ui",
requires = "mfussenegger/nvim-dap",
config = function()
require("dapui").setup({})
end,
})
if install_plugins then
packer.sync()
end
end)
vim.cmd([[
command! DapUIToggle lua require("dapui").toggle()
]])
I tried adding nvim-dap-python
to the minimal config, but couldn't make it working. The problem occurs for adapters that set console
to intergratedTerminal
(https://github.com/mfussenegger/nvim-dap/blob/master/doc/dap.txt#L526) and won't happen without starting a debug session first. Afterwards, no active debug session is needed to trigger it.
I'll try expanding your config a bit more and see if I can make it work.
Edit: I give up. I have removed neotest from my LunarVim config, and now I no longer have this issue. It is some odd conflict between multiple plugins - happy to close...
I'm having the same issue. I believe it's the conflict between the plugins that causes this problem.
To work around on this, I force dapui.setup()
every time I close the debug session.
local dap = require("dap")
local dapui = require("dapui")
local config = {
layouts = {
{
elements = {
{ id = "scopes", size = 0.25 },
"breakpoints",
"stacks",
"watches",
},
size = 40,
position = "left",
},
{
elements = { "repl" },
size = 0.25, -- 25% of total lines
position = "bottom",
},
},
}
dapui.setup(config)
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open({
reset = true,
})
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close({})
dapui.setup(config)
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close({})
dapui.setup(config)
end
My investigation
I use 'kevinhwang91/nvim-ufo' which requires 'kevinhwang91/promise-async'. By disabling both plugins, the problem seems to disappear. So I believe these plugins might cause the conflict.
Moreover, I tried disabling dapui.close
on terminated/exited and the problem still persisted.
Interesting that it seems to be a conflict between plugins. nvim-dap-ui an neotest both use an async framework that should be compatible (but also should never need to interact) whereas promise-async is a completely different style.
I am using all of these plugins without issue so unfortunately I can't debug further. @siraphobk are you able to reproduce using a minimal init.lua?
@rcarriga I might be wrong about those plugin conflicts tho. However, I'll try to setup using a minimal init.lua and will post it here.
I believe this was due to a neovim core bug, and has been fixed in nightly (possibly 9.1). Closing this but let me know if it's still an issue
https://github.com/rcarriga/nvim-dap-ui/issues/188#issuecomment-1354291183 mentioned this is caused by setting
console
tointegratedTerminal
, whichnvim-dap-python
does.Steps to reproduce: