syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.71k stars 4.9k forks source link

After commit 5ff44b Spacemacs shows light theme before selected theme is loaded #16683

Closed niontrix closed 1 day ago

niontrix commented 3 days ago

Hi folks!

I updated Spacemacs today and am using doom-one as my default theme. Since the recent commit 5ff44b Spacemacs now starts up with the light theme until the package load is done and only after that switches to the configured theme. The behavior is the same for all themes except when using spacemacs-dark. I know it is a minor issue, but it is a regression from the previous state. How can we fix this?

KR, niontrix

sunlin7 commented 3 days ago

Hi @niontrix The commit 5ff44b fixed 3 issues as I list in the MR #16650, and these issues affect Spacemacs a lot.

For loading theme early, we maybe need research a new way to do that.

sunlin7 commented 3 days ago

@niontrix Could you past your theme configuration, then I can reproduce the issue on my local? Thanks

niontrix commented 3 days ago

Hi @sunlin7! Thanks for getting back to me so fast :smile: My theme configuration is:

   dotspacemacs-themes '(doom-one
                         monokai-pro
                         spacemacs-dark
                         spacemacs-light)
sunlin7 commented 3 days ago

Will try on my local and update later.

niontrix commented 3 days ago

I read you comments on your PR. You wrote that the default fallback theme should be spacemacs-dark, right? But now it looks like this when I start up Emacs:

image

niontrix commented 3 days ago

Also it seems, that now the light theme is applied as default on the mode line, too, which changes the colors of the evil state indicators.

image

sunlin7 commented 3 days ago

The 5ff44b will apply the fallback theme at last if failed to load the desired theme, while previous behavior will apply the fallback theme after first failed on theme and apply the fallback theme again after second failed on theme.

I'm going to create a MR to try best to compatible with previous behavior.

niontrix commented 3 days ago

But why would the current theme (which is doom-one in my case) not be loaded, after the package has been installed? The white background is always the first thing to be seen until the packages are loaded. If I understood you right, then my preferred theme should be loaded first and only if it can't be loaded should the fallback theme be applied. But as I am writing this, I think that is the problem already. The custom theme is not loaded at that point so the fallback theme is applied. But furthermore, like I asked before, why is the background white, which seem to imply that spacemacs-light is loaded, but as I understood it, the fallback should be spacemacs-dark, right?

sunlin7 commented 3 days ago

Hi @niontrix Please review the MR #16685, should be able to act like previous behavior. And you're right for the fallback theme should be spacemacs-dark, but actually the light theme you saw on the startup is the default theme.

And you can image that, if a user prefer a light theme in a package, who will see a theme flashing.

The PR give a change to customer to set a light theme as the fallback theme or set a nil.