rcarriga / nvim-dap-ui

A UI for nvim-dap
MIT License
2.39k stars 87 forks source link

Watches, Scopes element's send_to_repl error #358

Open chc39615 opened 1 month ago

chc39615 commented 1 month ago

OS: Windows11 10.0.22631 Terminal: Wezterm shell: PowerShell

In Watches, Scopes buffer, when I press "r" send_to_repl. I expect see a float window show the variable i choosed. But return error

E5108: Error executing lua: ...Data/Local/nvim-data/lazy/nvim-dap-ui/lua/dapui/util.lua:266: attempt to index local 'elem' (a function v
lue)
stack traceback:
    ...Data/Local/nvim-data/lazy/nvim-dap-ui/lua/dapui/util.lua:266: in function 'float_element'
    ...Data/Local/nvim-data/lazy/nvim-dap-ui/lua/dapui/util.lua:254: in function 'callback'
    ...l/nvim-data/lazy/nvim-dap-ui/lua/dapui/render/canvas.lua:146: in function <...l/nvim-data/lazy/nvim-dap-ui/lua/dapui/render/canvas.lua:138>

I have updated the nvim-dap-ui to latest commit 5934302. Is this a bug or just need to set something correctly?

istrupin commented 6 days ago

@rcarriga I'm also getting this error on trying to send a variable to repl.

OS: MacOS Sonoma 14.5 Terminal: Iterm2 Shell: zsh

My config:

{
        "rcarriga/nvim-dap-ui",
        dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
        -- all defaults except I got rid of the console (for now).
        -- Can just replace opts with {} to get back to defaults.
        opts = {
            layouts = { {
                elements = { {
                    id = "scopes",
                    size = 0.25
                }, {
                    id = "breakpoints",
                    size = 0.25
                }, {
                    id = "stacks",
                    size = 0.25
                }, {
                    id = "watches",
                    size = 0.25
                } },
                position = "left",
                size = 40
            }, {
                elements = { {
                    id = "repl",
                    size = 1
                },
                    -- {
                    --     id = "console",
                    --     size = 0.25
                    -- }
                },
                position = "bottom",
                size = 10
            } }
        },
        config = function(_, opts)
            local dap = require("dap")
            local dapui = require("dapui")
            dap.listeners.after.event_initialized["dapui_config"] = function()
                dapui.open({})
            end
            dap.listeners.before.event_terminated["dapui_config"] = function()
                dapui.close({})
            end
            dap.listeners.before.event_exited["dapui_config"] = function()
                dapui.close({})
            end
            dapui.setup(opts)
        end,
    }