mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(dim): fixed the issue of dim's scope variable being nil and outputting… (#1938)
## Description During my use of dim, I found that an empty document can cause Snacks to output error messages, resulting in an instant freeze when opening an empty file ## Related Issue(s) - Fixes #1810 ## Screenshots before change  after change 
This commit is contained in:
parent
839022302b
commit
943a3c7d4a
1 changed files with 3 additions and 1 deletions
|
|
@ -108,7 +108,9 @@ function M.enable(opts)
|
|||
buf = buf,
|
||||
}
|
||||
end
|
||||
|
||||
if scope == nil then
|
||||
return
|
||||
end
|
||||
Snacks.animate(scopes_anim[win].from, scope.from, function(v)
|
||||
if not scopes_anim[win] or not vim.api.nvim_win_is_valid(win) then
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue