vim / colorschemes

colorschemes for Vim
276 stars 23 forks source link

set t_Co=0 ignores _tcozero #202

Closed neutaaaaan closed 2 years ago

neutaaaaan commented 2 years ago

If TERM=vt100, vim behaves as intended, and uses _tcozero. The actual value of t_Co doesn't matter. If you manually switch from any t_Co value to zero, everything breaks, and vim goes back to the noisy mess we were trying to avoid initially.

This feels like one of the one of those vim quirks we can't actually fix ourselves, but I don't remember having that problem before.

habamax commented 2 years ago

This feels like one of the one of those vim quirks we can't actually fix ourselves, but I don't remember having that problem before.

This is how colortemplate works. We can't define both term and cterm.

habamax commented 2 years ago

What I mean, once you have set t_Co=0 you should re-do colorscheme whatever

neutaaaaan commented 2 years ago

What I mean, once you have set t_Co=0 you should re-do colorscheme whatever

This doesn't work with any of the colorschemes that include _tcozero. It probably has something to do with the recent changes, because it works in a version of Iosvkem I compiled months ago.

habamax commented 2 years ago

and you're right..

habamax commented 2 years ago

I can make it work with following steps:

  1. colo blue
  2. set t_Co=0
  3. syn off
  4. set t_Co=0
  5. syn on

For some reason t_Co is undefined first time I do it... not sure why

habamax commented 2 years ago

if you do vim -Nu NONE and then

  1. :set t_Co=0
  2. :set t_Co?

it would echo t_Co=

if you repeat :set t_Co=0 then it would be set...

so "to make it work" one should do following:

  1. vim -Nu NONE
  2. :set t_Co=0
  3. :set t_Co=0
  4. :syn on
  5. :colo blue

I don't know if we can capture that empty t_Co and should we do it at all provided TERM=vt100 works.

habamax commented 2 years ago

I don't know if we can capture that empty t_Co

let s:t_Co = exists('&t_Co') && &t_Co >= 0 ? (&t_Co ?? 0) : -1

works for me, but I don't know if it would be ok, and again, not sure if @lifepillar would merge another PR on this matter :)

lifepillar commented 2 years ago

I can't experiment on these settings right now. But if you think something should be changed in the way the color schemes are built, please go ahead and open a PR, or even only an issue!

I am open to discuss a different structure for the generated code: at this point (and long before this point), you have had much more experience than me.

habamax commented 2 years ago

I wrote in commit message: It should fix ... And github closed this one :)