Th3Whit3Wolf / one-nvim

Atom one theme
MIT License
113 stars 23 forks source link

Error when setting colorscheme to one-nvim #23

Open chucktuffli opened 3 months ago

chucktuffli commented 3 months ago

NVIM v0.10.1 Ubuntu 22.04

Running :colorscheme one-nvim generates the following error message:

Error detected while processing /home/tuffli/.local/share/nvim/lazy/one-nvim/colors/one-nvim.vim:
line  718:
E5108: Error executing lua [string ":lua"]:712: loop or previous error loading module 'one-nvim'
stack traceback:
        [C]: in function 'require'
        [string ":lua"]:712: in main chunk
Press ENTER or type command to continue
kah-ell commented 3 weeks ago

Depending on how desperate you are to use this colorscheme, you can fix it somewhat.

This is were it breaks apart in Neovim:

local _USE_HEX = go.termguicolors
local _USE_256 = tonumber(go.t_Co) > 255     -- nvim doesn't know about vim.go.t_Co 
    or string.find(vim.env.TERM, '256')      --      (see :help t_xx)

If you know your terminal supports TrueColor (the hexcode colors like #BADA55), just delete the last two lines above (beginning with local _USE_256... and replace it with local _USE_256 = false. This breaks detection on non-Truecolor terminals, but most modern terminals (kitty, wezterm, konsole, ...) support it by now anyway.

If your term only supports 256 colors, instead replace the lines with a local _USE_256 = true.

It's going to blow up if you update the plugin, but for a quick fix and to check out the colorscheme it should be ok.