Closed lostl1ght closed 2 years ago
Hi buddy, how are you, thanks for bringing this problem to our attention. I wanted to ask you where you are calling the setup function, as I have tested it on two computers and it works correctly both in a module loaded automatically by the editor (in the after directory) and in the 'config' callback that the 'Packer' package manager has.
I show you briefly my configuration. it is located in the after/plugin directory in a file named like the theme.
I have a loader function. It is a wrapper around packer
:
It is called from init.lua
file:
Parameter for the loader is a table and looks like this:
Config looks like this:
llvim.style
is just a global, and if I replace it with a string 'midnight'
I still get a night
variant.
I have cloned your configuration and I am changing the value of the global variable llvim.style and apparently on my pc it works.
do you think it is possible to verify if really the value you give to this variable is arriving correctly to the theme setup, generally when a value is not specified in the "variant" attribute it will be set by default night
however it is weird because in my machine it works
I have added a print inside set_scheme:
And this is what I see when I start nvim:
You can see set_scheme
is called twice.
I've also used inspect library to print tables:
And that's what I see:
setup_scheme
function is called twice.
The first 2 tables in the output are opts
and conf
from my config.
The third table is nil
because setup_scheme
is called without arguments so opts
is nil
and conf
is the default fourth table.
So yes, the value arrives correctly but then the config gets changed to default by the second setup_scheme
call.
I understand, and upon review you are right, and I think I know where the problem is. Try commenting out the line "require(" nebulous.utils").setup_scheme()" inside colors/nebulous.vim in the theme, that's where you overwrite the user configuration (just as you mentioned). It is something that I see is causing problems and I will remove it from there, just as the readme mentions the theme is set by means of its setup function.
Thank you, it helped.
As far as I'm concerned, plugins are loaded asynchronously. So maybe on your machine nebulous.vim
is loaded before nebulous.lua
and on mine vice versa. Maybe that's why you couldn't reproduce this issue.
Solved in 9cb59ab
Bug description
Since ade7d7d I can no longer change theme variant using
setup
function.Steps to reproduce
Additional information
I have discovered that this may happen due to
setup_scheme
function being called twice. The first time it is called with user parameters bysetup
function. The second time it is called fromnebulous.vim
file with default parameters.