-
Notifications
You must be signed in to change notification settings - Fork 29
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
Higlight group definitions with discriminators and without variant restrictions check has('gui_running')
(v3)
#83
Comments
This is actually insightful. The default should probably be top-level and then an explicit Edit: Maybe make |
has('gui_running')
has('gui_running')
(v3)
Thanks for the feedback! And thanks for your patience with v3, which is currently lacking thorough documentation. There are two parts to the issue you are raising: one is the intended semantics of the template (correctness), the other is how the code is generated (optimization). Regarding the semantics: Colortemplate supports a If you add Then, there's the code generation. You are right that checking for
Here,
|
I currently have In other words, (Unrelated: how do you produce the nice formatting like that?) |
Can you post a minimal full template that shows the issue you have? |
So in the example above
^ this part is incorrect, no? The 256 variant would correctly style Normal with the discriminator's alternative styling when the boolean is true, but the terminal true color variant would not. Only the GUI would see the difference here. Edit: Updated build output... there was an error preventing it from building with just the 256 variant. |
Ok, let's consider all the cases:
hi Normal guifg=#012345 ctermfg=235 guibg=#abcdef ctermbg=153 guisp=#abcdef ctermul=153 cterm=undercurl If
Does it make sense? Isn't this the actual behavior of this color scheme?¹ ¹
With patience :-) That's just manually indented. |
Oh… that’s right (oops). Out of curiosity, why are the gui/cterm properties merged into one |
The form of the generated code is not set in stone. It is well possible—likely, I'd say—that in the future the output format will change. One of the reasons I've started the v3 branch is that I wanted to refactor the code so that adding new code generators becomes relatively easy. In fact, there are already two generators: one for legacy Vim script, and one for Vim 9 script.
The current state of affairs, which is not ideal yet, is partly due to the way Colortemplate has evolved over time. At the beginning, I thought that it would be a good idea to define only the attributes that are relevant for the current environment: only So, to answer your question: yes, that's likely the direction Colortemplate will take. Providing full highlight group definitions with all the attributes may simplify some things, at the expense of a slightly slower, but likely imperceptible, loading time. |
Fair enough. I know you've heard a lot from me lately, but I have no further qualms. I completed my first template with v3 and I'm very pleased... and I also find making colorschemes in this way somewhat addicting now. So thank you! |
In a terminal with true colors,
has('gui_running')
returns false, but it should be able to render the guifg/guibg colors. Perhaps I am misunderstanding, but the conditional check seems unnecessary since all other gui highlight definitions appear at the top level.For example,
generates
The gui_running check seems to be incorrect; I think just the boolean check would be appropriate.
The text was updated successfully, but these errors were encountered: