noice.nvim icon indicating copy to clipboard operation
noice.nvim copied to clipboard

bug: Synergy with nvim-dap / cmdline_popup not dissapearing

Open kristiansordal opened this issue 5 months ago • 0 comments

Did you check docs and existing issues?

  • [X] I have read all the noice.nvim docs
  • [X] I have searched the existing issues of noice.nvim
  • [X] I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.10.0

Operating system/version

MacOS Sonoma

Describe the bug

I'm trying to get this plugin to work in conjunction with nvim-dap. I'm unsure where to route the debug start menu, as it doesn't have a unique kind according to notify, i.e. it's on the form msg_show. I'd like to route it to the cmdline_popup view, but the issue is that it doesnt go away after confirmation, as seen in the video below.

Screenshot 2024-01-16 at 15 17 24 video

For now I'll just use the normal notify view, but I'm not too fond of it, so having some synergy with nvim-dap would be nice.

Steps To Reproduce

  1. Filter msg_show with kind = "" to "cmdline_popup"
  2. Watch it not dissapear.

Expected Behavior

The popup to dissapear.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/noice.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
---------- NOTIFY -------------
require("notify").setup({
    background_colour = "#000000",
})

require("telescope").load_extension("noice")
---------- NOICE --------------
---
require("noice").setup({
    cmdline = {
        view = "cmdline_popup", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom
        format = {
            cmdline = { pattern = "^:", icon = "|>", lang = "", title = "" },
        }
    },
    views = {
        cmdline_popup = {
            position = {
                row = 5,
                col = "50%",
            },
            size = {
                width = 40,
                height = "auto",
            },
        },
        popupmenu = {
            relative = "editor",
            position = {
                row = 8,
                col = "50%",
            },
            size = {
                width = 40,
                height = 10,
            },
            border = {
                style = "rounded",
                padding = { 0, 1 },
            },
            win_options = {
                winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" },
            },
        },
    },
    presets = {
        bottom_search = true,         -- use a classic bottom cmdline for search
        long_message_to_split = true, -- long messages will be sent to a split
        inc_rename = false,           -- enables an input dialog for inc-rename.nvim
        lsp_doc_border = false,       -- add a border to hover docs and signature help
    },
    lsp = { progress = { enabled = false } },
    notify = { enabled = false },
    errors = { enabled = false },
    -- routes = {
    --     {
    --         filter = {
    --             event = "msg_show",
    --             ["not"] = {
    --                 kind = { "confirm", "confirm_sub", "" },
    --             },
    --         },
    --         opts = { skip = true },
    --     },
    -- },
    routes = {
        {
            filter = { event = "msg_show", kind = "confirm_sub" },
            opts = { skip = true },
        },
        {
            filter = { event = "msg_show", kind = "confirm" },
            opts = { skip = true },
        },
        {
            filter = { event = "msg_show", kind = "info" },
            opts = { skip = true },
        },
        {
            filter = { event = "msg_show", kind = "emsg" },
            opts = { skip = true },
        },
        {
            filter = { event = "msg_show", kind = "echo" },
            opts = { skip = true },
        },
        {
            filter = { event = "msg_show", kind = "echomsg" },
            opts = { skip = true },
        },
        {
            filter = { event = "msg_show", kind = "echoerr" },
            opts = { skip = true },
        },
        {
            filter = { event = "msg_show", kind = "lua_error" },
            opts = { skip = true },
        },
        {
            filter = { event = "msg_show", kind = "rpc_error" },
            opts = { skip = true },
        },
        {
            filter = { event = "msg_show", kind = "return_prompt" },
            opts = { skip = true },
        },
        {
            filter = { event = "msg_show", kind = "quickfix" },
            opts = { skip = true },
        },
        {
            filter = { event = "msg_show", kind = "search_count" },
            opts = { skip = true },
        },
        {
            filter = { event = "msg_show", kind = "wmsg" },
            opts = { skip = true },
        },
        {
            view = "cmdline_popup",
            filter = { event = "msg_show", kind = "" },
        },
    }
})

kristiansordal avatar Jan 16 '24 14:01 kristiansordal