onebuddy icon indicating copy to clipboard operation
onebuddy copied to clipboard

bug: can not get light colorscheme

Open matu3ba opened this issue 4 years ago • 5 comments
trafficstars

Minimal init.lua:

setting vim.o.background to light has no effect

--vim.o.background = 'light'; --inserting here does not have an effect
require('packer').startup(
function()
  use { 'wbthomason/packer.nvim' }
  use { 'glepnir/lspsaga.nvim', requires = { 'neovim/nvim-lspconfig' } }
  use { 'Th3Whit3Wolf/onebuddy', requires = { 'tjdevries/colorbuddy.nvim' } }
end
)
require('colorbuddy').colorscheme('onebuddy')
vim.o.background = 'light'; --sets vim.o.background, but I dont get the light colorscheme

in commandline: :lua print(vim.o.background) returns light, but the light colorscheme is not loaded.

It gets reset somewhere, when I set it in the first line. Ideas? Is this a neovim regression?

matu3ba avatar Mar 26 '21 14:03 matu3ba

That's pretty weird. Does the color change when you enter :lua vim.o.background

Th3Whit3Wolf avatar Mar 31 '21 22:03 Th3Whit3Wolf

@Th3Whit3Wolf Found the reason why. I guess this was changed upstream in colorbuddy.nvim at some point, but not documented:

https://github.com/tjdevries/colorbuddy.nvim/issues/17

Would be nice to document in usage of all your colorschemes or tell TJ to change:

require('colorbuddy').colorscheme('onebuddy', bg) where bg is either dark or light

matu3ba avatar Apr 01 '21 09:04 matu3ba

For further inspiration of async loading stuff or using treesitter colorgroups consider stealing from glepnir: https://github.com/glepnir/zephyr-nvim/blob/main/lua/zephyr.lua

matu3ba avatar Apr 01 '21 09:04 matu3ba

Sorry I have been busy. Would you mind sending a pull request?

Th3Whit3Wolf avatar Apr 18 '21 17:04 Th3Whit3Wolf

@Th3Whit3Wolf I dont use onebuddy, since Treesitter alredy provides relative nice colorgroups: https://github.com/glepnir/zephyr-nvim/blob/main/lua/zephyr.lua

I was only noticing the bug on testing different colorschemes.

matu3ba avatar Apr 20 '21 21:04 matu3ba