mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-03 18:28:38 +00:00
fix(picker.colorscheme): nil check. Fixes #575
This commit is contained in:
parent
559ab72696
commit
de01907930
1 changed files with 3 additions and 3 deletions
|
@ -250,10 +250,10 @@ function M.colorscheme(ctx)
|
|||
ctx.preview.state.colorscheme = vim.g.colors_name or "default"
|
||||
ctx.preview.state.background = vim.o.background
|
||||
ctx.preview.win:on("WinClosed", function()
|
||||
if not ctx.preview.state.colorscheme then
|
||||
return
|
||||
end
|
||||
vim.schedule(function()
|
||||
if not ctx.preview.state.colorscheme then
|
||||
return
|
||||
end
|
||||
vim.cmd("colorscheme " .. ctx.preview.state.colorscheme)
|
||||
vim.o.background = ctx.preview.state.background
|
||||
end)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue