Does centered_float widgets keep listening to scope events after close? #1171
-
Using this mapping was slowing down my neovim instance by a lot. local widgets = require("dap.ui.widgets")
local scopes_sidebar = widgets.sidebar(widgets.scopes, { number = true, wrap = false })
vim.keymap.set("n", "<leader>ds", scopes_sidebar.toggle, { desc = 'DAP: Toggle "scopes" in sidebar' }) On the other hand, this one seems to perform better. ...
function()
local ui = require("dap.ui.widgets")
ui.centered_float(ui.scopes, { number = true, wrap = false })
end,
... I just wanted to ask what is the lifetime of a Also, any ideas on how to better debug the performance of the first keymap? I believe I might be able to replicate the issue. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The The point about the sidebar always listening is a good one. I should tune that to only listen while the view is open. To clarify: the slowdown only happens when a breakpoint is hit, or in general? The listeners are only triggered if the scopes get refreshed (which then redraws all the variables) |
Beta Was this translation helpful? Give feedback.
The
centered_float
doesn't add any listener at all - it also won't refresh while it's vissible.The point about the sidebar always listening is a good one. I should tune that to only listen while the view is open.
To clarify: the slowdown only happens when a breakpoint is hit, or in general? The listeners are only triggered if the scopes get refreshed (which then redraws all the variables)