Skip to content

Commit

Permalink
fix(layout): use debounce for resizes
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 3, 2023
1 parent c0ae068 commit 640b98b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/edgy/layout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function M._layout(state)
-- Layout the sidebars when needed
if state.tries > 1 or M.needs_layout() then
M.foreach({ "bottom", "top", "left", "right" }, function(sidebar)
sidebar:layout(wins)
sidebar:layout()
end)
return true
end
Expand All @@ -166,7 +166,8 @@ function M._resize()
end
end

M.resize = Util.throttle(M.wrap(M._resize), 300)
-- M.resize = Util.throttle(M.wrap(M._resize), 300)
M.resize = Util.debounce(M.wrap(M._resize), 50)

M.update = M.wrap(function(state)
if M._layout(state) then
Expand Down

0 comments on commit 640b98b

Please sign in to comment.