AlphaTechnolog/pywal.nvim

Doesn't auto update.

Reikimann opened this issue · 4 comments

When generating new colorscheme, nvim does not update the colorscheme. I believe wal.vim does that. Could you implement it?

My pywal.nvim update the colorscheme at update the pywal palette, but because it works for termguicolors I cannot generate in live time the colorscheme, you try restarting neovim?

Check the colors in the file ~/.cache/wal/colors.vim and check if pywal generate the appropiate colors in it file

The plugin works fine.
What I meant is that, it would be nice if you wouldn't need to restart nvim.

oh okay sorry haha... anyway I'll explain why it can't be implemented

the reason wal.vim updates the color palette without updating nvim is because wal.vim uses colors directly from the terminal using things like:

hi Normal ctermbg=13 ctermfg=3

Or something similar, what this causes is that vim reads the colors from the terminal palette (which are changed by pywal) and then they are updated by the terminal (not by vim)

However, pywal.nvim cannot do this because in order to make colors work in a neovim gui (the termguicolors) it is using hexadecimal colors not terminal colors such as 15 or 13, this is why pywal .nvim reads from the ~/.cache/wal/colors.vim file the variables generated by pywal (which contain those hexadecimals) and then applies the hexadecimals to the guibg or guifg depending

the problem with this and because the change cannot be implemented in real time, is because the hexadecimals are already in memory and the highlights are not updated (still updating the file, because there is no observer to capture the new variables and return to generate the theme) that is why it is necessary to restart neovim, so that the file with the variables is read again, and the new theme is generated

It occurs to me to investigate in any way how to make an observer that does not spend so much memory and that is fast in neovim with lua

That is why I am closing the issue, I will be investigating about the observers and if possible, I will reopen this issue.

Thanks for using pywal.nvim

I have no issue running colorscheme pywal after having run wal. I haven't needed to restart nvim in order to update the colorscheme, but it's still a manual update that I need to make.

Would it be possible to send a signal to any/all running nvim instances with a command to execute the colorscheme/setup command? I could see something like this being part of a wal-set script executed using pywal's -o flag, as with other applications.