Open clach04 opened 11 hours ago
Obviously this DOES impact https://github.com/lifepillar/vim-wwdc17-theme
Thanks for your feedback. The italics check is a hack, in fact, but that's the first report I get of an environment where it doesn't work.
What's the best way to fix this?
I don't think there is a proper “fix”: we may try to mitigate the problem. In this case, I have no preference between your proposed workarounds: if you tell me that they both work and offer an argument to prefer one, I will use that. I wonder if there is a way to enable italics under your environment and if there is a way to reliably detect it (I doubt it).
I'm wondering if this also impacts [Colortemplate]
Yes it does, and it does impact all the color schemes generated by Colortemplate v2 that use italics in some highlight group.
Colortemplate v3 does not implicitly add any check for italics, leaving the responsibility to the template's author, so this issue does not affect Colortemplate v3.
Thanks for the quick response @lifepillar!
I propose a change to:
let s:italic = has('gui_running') || has('nvim') || (&t_ZH != '' && &t_ZH != '[7m' && (!has('win32') && !has("gui_running")))
changing the italic-check-hack to switch the order, with more easily understood items at the start and then the less obvious stuff at the end (it was tempting to move the t_ZH check right at the end).
I think a Windows-specific check, with a Windows non-GUI check is the least-worst way to avoid italics accidentally being enabled ;-)
It's in band aid territory. I will try and come up with a smaller test case for vim upstream to get some clarity on expected behavior.
I also think it's worth a comment in the file as an explanation to what is going on (I do not recognize the escape sequences, I don't recognize the Windows one I found 🤣 ).
I'm not at all familiar with the templating framework here, it's on my backlog of cool stuff to check out. I'm assuming the change would be made to https://github.com/lifepillar/vim-wwdc16-theme/blob/master/template/wwdc16.colortemplate#L68 ? I've simply been hacking the color/wwdc16.vim file 😆
Quickly opened https://github.com/vim/vim/issues/15723 to see if we can gain any insight on the Windows side of things.
Vim version info at end.
I'm seeing comments showing up with a bright yellow background under Windows 10 with CMD. gvim is fine, as is Linux (with an older vim version).
The problem appears to be related to the italic check.
demo screenshot of the problem
Using:
Comments are in a bright yellow background
A hack to fix this is:
If I echo the t_ZH I see:
Annoyingly I could not see in Vim that the
^
character was a real escape character.My initial attempt at a fix:
failed, but using a real escape char did:
This monstrosity also works for me :-) and maybe more obvious:
What's the best way to fix this? The embedded escape is surprising so I'm not sure on best way forward. Happy to post a PR once figured out.
I'm wondering if this also impacts https://github.com/lifepillar/vim-colortemplate ?
Thanks for making this available, very neat! 🙏
vim 9.0 version details