perf(picker): use picker ref in progress updater. Fixes #710

This commit is contained in:
Folke Lemaitre 2025-01-23 15:48:08 +01:00
parent 611df4b3ad
commit 37f3888dcc
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -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