mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
perf(picker): use picker ref in progress updater. Fixes #710
This commit is contained in:
parent
611df4b3ad
commit
37f3888dcc
1 changed files with 5 additions and 0 deletions
|
@ -519,7 +519,12 @@ function M:progress(ms)
|
|||
if self.updater:is_active() or self.closed then
|
||||
return
|
||||
end
|
||||
local ref = self:ref()
|
||||
self.updater = vim.defer_fn(function()
|
||||
local self = ref()
|
||||
if not self then
|
||||
return
|
||||
end
|
||||
self:update()
|
||||
if not self.closed and self:is_active() then
|
||||
-- slower progress when we filled topk
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue