rcarriga / nvim-dap-ui

A UI for nvim-dap
MIT License
2.64k stars 96 forks source link

Unexpected insert behaviour after updating #227

Closed Bryaneven closed 1 year ago

Bryaneven commented 1 year ago

I updated the plugin from 2.6.0 to 3.2.5 this morning , after using the REPL and closing it , i now have a strange behaviour where every keys i press put me in insert mode and a new line pop under my lualine.

Screenshot 2023-02-01 at 14 53 24

Downgrading the version to 3.2.2 did the trick so it seems that the issue is caused by the v3.2.3 changes .

LucasTavaresA commented 1 year ago

im having that, happens at 3953824

huyiqun commented 1 year ago

experiencing the same problem

willydeliege commented 1 year ago

Same here

rcarriga commented 1 year ago

If someone can provide a minimal init.lua to reproduce, I can figure out the issue as right now unfortunately I cannot reproduce. Here's a starter one you can run with nvim --clean -u minimal.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()
]])
yao-weijie commented 1 year ago

If someone can provide a minimal init.lua to reproduce, I can figure out the issue as right now unfortunately I cannot reproduce. Here's a starter one you can run with nvim --clean -u minimal.lua

I met similar problem when using the following settings:

    config = function() -- dapui config
        local dap, dapui = require("dap"), require("dapui")
        dapui.setup(opts) -- my dap-ui settings, not important

        local debug_open = function()
            dapui.open()
        end
        local debug_close = function()
            dap.repl.close()  -- key point
            dapui.close()
        end

        dap.listeners.after.event_initialized["dapui_config"] = debug_open
        dap.listeners.before.event_terminated["dapui_config"] = debug_close
        dap.listeners.before.event_exited["dapui_config"] = debug_close
        dap.listeners.before.disconnect["dapui_config"] = debug_close
    end,

this config result in very strange insert behaviour, for example, after dap debug finished, I press any key, it will go into insert mode.

This is caused by dap.repl.close(), I removed this line, and all bugs gone!

dap.repl.close() will be called in dapui.close(), there's no need to call it manully, if add it in user config, it will cause strange behaviour!

yao-weijie commented 1 year ago

In dapui old versions, repl will not be closed automatically, so I need to add dap.repl.close(),

But in dapui recent versions, repl closed behaviour is controlled by dapui.close(), that't the difference :)

marcomayer commented 1 year ago

I'm also having issues with insert mode after calling dapui.close(). The only thing that fixes it is calling dapui.open() again, then I can type normally but whenever I call close again it's screwed :/

Unfortunately don't have the time to dive deeper right now but in my case the dap.repl.close() workaround doesn't do it.

jamespixovr commented 1 year ago

I'm also having issues with insert mode after calling dapui.close(). The only thing that fixes it is calling dapui.open() again, then I can type normally but whenever I call close again it's screwed :/

I am having the same problem.

bcp-dev-ops commented 1 year ago

same problem as well

bcp-dev-ops commented 1 year ago

262 can confirm that updating to nightly neovim resolves this for me

rcarriga commented 1 year ago

Closing as the fix is in neovim, not nvim-dap-ui