Skip to content

Calling toggle multiple times on a widget causes the new text to get appended instead of replaced #1042

@TheLeoP

Description

@TheLeoP

Debug adapter definition and debug configuration

Install any adapter and use any valid nvim-dap configuration.

Debug adapter version

No response

Steps to Reproduce

  1. Create the following mapping to toggle a widget (any widget is fine, not only scopes)
local scopes = require("dap.ui.widgets").scopes
local sidebar_scopes = require("dap.ui.widgets").sidebar(scopes)
vim.keymap.set("n", "<F5>", function()
  sidebar_scopes.toggle()
end)
  1. Start a debugging session (with any adapter)
  2. Press <F5> three times (open it, close it and open it again)

Expected Result

The widget content should be shown only one time.

Actual Result

The widget content is shown two times (and if we keep toggling the widgets, each time it gets opened it's content is appended one more time).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions