mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-07 12:18:10 +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
|
stats.scope = stats.scope + 1
|
||||||
if scope then
|
if scope then
|
||||||
scope.win = win
|
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)
|
step(scope, 0)
|
||||||
Snacks.animate(
|
Snacks.animate(
|
||||||
0,
|
0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue