lifepillar/vim-colortemplate

Invalid expression error when loading colorscheme

rjurga opened this issue · 3 comments

I'm playing around with vim-colortemplate for the first time, trying to create a colorscheme. The template is hosted on this Github repository.

It works fine on my Windows setup, where I use gvim. However, it has an error on my Linux setup, where I use neovim (v0.7.2) in the alacritty terminal (v0.10.1). Upon setting the colorscheme with :colorscheme dao, I get the following errors:

Error detected while processing .vim/colors/dao.vim:
line   16:
E15: Invalid expression: ? 0) : -1
line  122:
E121: Undefined variable: s:t_Co
line  191:
E121: Undefined variable: s:t_Co

In the generated dao.vim script, this is the line 16 which causes the issue:

let s:t_Co = exists('&t_Co') && !has('gui_running') ? (&t_Co ?? 0) : -1

After this error message, the colorscheme appears to works properly, but it's annoying to have the error every time.

I don't know the vim script syntax so I have no clue why it doesn't work, but given that this is generated through vim-colortemplate, I thought I would report it here.

Thanks for reporting! It appears that Neovim does not support the ?? operator. I have to fix that. You may checkout the latest stable version (v2.2.0) until a fix is ready.

Oh well, there's a PR already. I would appreciate it if you could try that.

I just tested it with the latest commit. It fixed the issue on my end. Thanks for the super fast fix.