Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid expression error when loading colorscheme #63

Closed
rjurga opened this issue Sep 15, 2022 · 3 comments · Fixed by #64
Closed

Invalid expression error when loading colorscheme #63

rjurga opened this issue Sep 15, 2022 · 3 comments · Fixed by #64

Comments

@rjurga
Copy link

rjurga commented Sep 15, 2022

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.

jchros added a commit to jchros/vim-colortemplate that referenced this issue Sep 15, 2022
Neovim doesn't support the falsy operator (as of version 0.7.2), so we
use the `+<expr>` trick to convert `&t_Co` into a number, since that's
how it is used in generated color schemes.

Fixes lifepillar#63.
@lifepillar
Copy link
Owner

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.

@lifepillar
Copy link
Owner

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

jchros added a commit to jchros/vim-colortemplate that referenced this issue Sep 15, 2022
Neovim doesn't support the falsy operator (as of version 0.7.2), so we
use the `+<expr>` trick to convert `&t_Co` into a number when the color
scheme must support Neovim, since that's how it is used in generated
color schemes.

Fixes lifepillar#63.
jchros added a commit to jchros/vim-colortemplate that referenced this issue Sep 15, 2022
Neovim doesn't support the falsy operator (as of version 0.7.2), so we
use the `+<expr>` trick to convert `&t_Co` into a number when the color
scheme must support Neovim, since that's how it is used in generated
color schemes.

Fixes lifepillar#63.
@rjurga
Copy link
Author

rjurga commented Sep 15, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants