xiyaowong / transparent.nvim

Remove all background colors to make nvim transparent
806 stars 23 forks source link

Doesn't work correctly (consistent) with FocusGained and FocusLost commands #64

Closed svanharmelen closed 4 months ago

svanharmelen commented 4 months ago

I added this to my config (also tried it with calling require('transparent').toggle()):

-- Make background solid again
autocmd('FocusGained', {
  callback = function()
    vim.cmd [[ TransparentDisable ]]
  end,
})

-- Make background transparent
autocmd('FocusLost', {
  callback = function()
    vim.cmd [[ TransparentEnable ]]
  end,
})

But it doesn't switch/toggle transparency correctly. When using the command manually it works as expected. Any ideas or suggestion on how to fix or troubleshoot?

Thanks!

svanharmelen commented 4 months ago

In case it matters, I'm using this theme but I'm not using the transparent option as it is only set on initial config: https://github.com/sainnhe/sonokai

svanharmelen commented 4 months ago

Closing this issue as (for now) I'm not going to use this plugin. Could be I'll reopen it later when I have some more time to play with it. Thanks!