Closed pocco81 closed 1 year ago
Ah, I just read the bottom line on the README. So this is supposed to enable transparency at startup, right?
In that case, with the logic above, this should be appended:
-- at the bottom of `setup()` at `config.lua`
if cache.read() then
require("transparent").toggle(vim.g.transparent_enabled)
end
-- where `cache.read()` should return true or false depending on `transparent_cache`
-- at the bottom of `toggle()` at `init.lua`
cache.write()
This is better because:
vim.g.transparent_enabled
should ideally track exclusively the state of transparency of its running NeoVim instance, and thus avoid being affected by said cachingcaching = false
VimLeave
?I'm not sure about your question as everything seems normal on my end. Could you please share your configuration for reference?
I don't really get it. Is it supposed to be used for synchronizing transparency states? Is it to load the last stage of transparency? If it's the latter then I don't think it works that well. Because say
transparency_cache
hastrue
. But then I go to open a neovim instance where transparency is not enabled at lunch, and when I run:TransparentToggle
I expect to enable transparency, but since the plugin first reads the cached file, it will try to disable transparency.Correct me if I'm wrong, but I think the logic is faulty? I had some issues with it so I rewrote
M.toggle()
:Let me know if I should make a PR.