mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
fix(dim): check that win is valid when animating dim. Closes #1342
This commit is contained in:
parent
6afb8debd6
commit
47e1440d54
1 changed files with 2 additions and 2 deletions
|
@ -110,7 +110,7 @@ function M.enable(opts)
|
|||
end
|
||||
|
||||
Snacks.animate(scopes_anim[win].from, scope.from, function(v)
|
||||
if not scopes_anim[win] then
|
||||
if not scopes_anim[win] or not vim.api.nvim_win_is_valid(win) then
|
||||
return
|
||||
end
|
||||
scopes_anim[win].from = v
|
||||
|
@ -118,7 +118,7 @@ function M.enable(opts)
|
|||
end, vim.tbl_extend("keep", { int = true, id = "snacks_dim_from_" .. win, buf = buf }, opts.animate))
|
||||
|
||||
Snacks.animate(scopes_anim[win].to, scope.to, function(v)
|
||||
if not scopes_anim[win] then
|
||||
if not scopes_anim[win] or not vim.api.nvim_win_is_valid(win) then
|
||||
return
|
||||
end
|
||||
scopes_anim[win].to = v
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue