mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
fix(indent): do animate check in bufcall
This commit is contained in:
parent
d2fafff5f3
commit
c62e7a2561
1 changed files with 6 additions and 4 deletions
|
@ -420,10 +420,12 @@ function M.on_scope(win, buf, scope, prev)
|
|||
scope.win = win
|
||||
local animate = Snacks.animate.enabled({ buf = buf, name = "indent" })
|
||||
|
||||
-- skip animation if new lines have been added before or inside the scope
|
||||
if prev and (vim.fn.nextnonblank(prev.from) == scope.from) then
|
||||
animate = false
|
||||
end
|
||||
vim.api.nvim_buf_call(buf, function()
|
||||
-- skip animation if new lines have been added before or inside the scope
|
||||
if prev and (vim.fn.nextnonblank(prev.from) == scope.from) then
|
||||
animate = false
|
||||
end
|
||||
end)
|
||||
|
||||
if animate then
|
||||
step(scope, 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue