Skip to content

Commit

Permalink
fix: allow multiple setup calls
Browse files Browse the repository at this point in the history
  • Loading branch information
rcarriga committed Jan 28, 2023
1 parent fc48a44 commit b67df85
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lua/dapui/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ end
---@eval return require('dapui.config')._format_default()
---@param user_config? dapui.Config
function dapui.setup(user_config)
for _, elem in pairs(elements) do
local buffer = elem.buffer()
if vim.api.nvim_buf_is_valid(buffer) then
vim.api.nvim_buf_delete(buffer, { force = true })
end
end
elements = {}

config.setup(user_config)

local client = require("dapui.client")(dap.session)
Expand Down

0 comments on commit b67df85

Please sign in to comment.