mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
feat(indent): don't animate indents when new scope overlaps with the previous one, taking white-space into account. See #264
This commit is contained in:
parent
39c009fe0b
commit
9b4a85905a
1 changed files with 5 additions and 1 deletions
|
@ -405,7 +405,11 @@ function M.on_scope(win, buf, scope, prev)
|
|||
stats.scope = stats.scope + 1
|
||||
if scope then
|
||||
scope.win = win
|
||||
if Snacks.animate.enabled({ buf = buf, name = "indent" }) then
|
||||
local animate = Snacks.animate.enabled({ buf = buf, name = "indent" })
|
||||
if prev and (vim.fn.nextnonblank(prev.from) == scope.from) then
|
||||
animate = false
|
||||
end
|
||||
if animate then
|
||||
step(scope, 0)
|
||||
Snacks.animate(
|
||||
0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue