nova.nvim icon indicating copy to clipboard operation
nova.nvim copied to clipboard

error while loading colorscheme

Open sugiura-hiromichi opened this issue 2 years ago • 8 comments

When

loading nova colorscheme by :colorscheme nova

Error Message

Error detected while processing /Users/(username)/.local/share/nvim/site/pack/packer/start/nova.nvim/colors/nova.lua:
E5113: Error while calling lua chunk: .../nvim/site/pack/packer/start/nova.nvim/lua/nova/init.lua:23: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
        [C]: in function 'pairs'
        .../nvim/site/pack/packer/start/nova.nvim/lua/nova/init.lua:23: in function 'load'
        ...re/nvim/site/pack/packer/start/nova.nvim/colors/nova.lua:1: in main chunk

Environment

OS: macOS Monterey 12.6
Nvim: v0.8.0

sugiura-hiromichi avatar Sep 17 '22 07:09 sugiura-hiromichi

Could you show your configuration?

zanglg avatar Sep 17 '22 09:09 zanglg

Em...maybe you forget to setup configuration before load the scheme, look this for your reference:

https://github.com/zanglg/nova.nvim/blob/46e0b9026a5eca7e07001e29ef2a9e692e3f980a/README.md?plain=1#L21-L32

PS: there should be a guard if someone forget configuration 😄

zanglg avatar Sep 17 '22 09:09 zanglg

added require'nova'.setup() and everything work fine... Thank you!

sugiura-hiromichi avatar Sep 17 '22 10:09 sugiura-hiromichi

Now I can use nova colorscheme. But I can't switch background color like light to dark or vice versa.

I'm currently using amdt/sunset plugin which automatically switch background color sync with sunset/sunrise. Thus I hope to set background via

set background=dark / light

or

vim.o.background='dark' / 'light'

Is there any way to do this?

sugiura-hiromichi avatar Sep 17 '22 11:09 sugiura-hiromichi

Also have a look at above, setup() has a parameter: require("nova").setup({ background = "dark" })

zanglg avatar Sep 17 '22 11:09 zanglg

Also have a look at above, setup() has a parameter: require("nova").setup({ background = "dark" })

Yes. I did that. But It seems only executed at Neovim startup. I look forward the way to switch background while using nova.

sugiura-hiromichi avatar Sep 17 '22 12:09 sugiura-hiromichi

Some work was not finished, you can's switch between dark and light while using Neovim. Some configuration was lost after first initialization, I'll fix this bug recently.

zanglg avatar Sep 17 '22 13:09 zanglg

OK. I've forgotten this project is WIP...
I'll wait for the release!

sugiura-hiromichi avatar Sep 17 '22 22:09 sugiura-hiromichi

Now, you can switch background with lua, like:

require("nova").setup({ background = "dark" })
require("nova").load()

set background = dark / light was still not used yet

zanglg avatar Sep 21 '22 15:09 zanglg

After 1e1da07 merged, it's able to switch background with set background = dark / light

This issue was closed, if there is still problems, please reopen it.

zanglg avatar Oct 17 '22 13:10 zanglg