mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
perf(util): improve impl of throttle
This commit is contained in:
parent
64fd346728
commit
36952153ec
2 changed files with 20 additions and 19 deletions
|
@ -67,7 +67,10 @@ function M.create()
|
|||
self.state = vim.deepcopy(default_state)
|
||||
|
||||
self.render = Render.new(self)
|
||||
self.update = Util.throttle(Config.options.ui.throttle, self.update)
|
||||
local update = self.update
|
||||
self.update = Util.throttle(Config.options.ui.throttle, function()
|
||||
update(self)
|
||||
end)
|
||||
|
||||
for _, pattern in ipairs({ "LazyRender", "LazyFloatResized" }) do
|
||||
self:on({ "User" }, function()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue