vim / colorschemes

colorschemes for Vim
279 stars 23 forks source link

check_colors vs !has('patch-8.0.0616') #118

Closed habamax closed 2 years ago

habamax commented 2 years ago

So check_colors has check 3 that doesn't like colortemplate output:

if s:t_Co >= 256
  hi! link ErrorMsg Error
  hi! link FoldColumn LineNr
  hi! link LineNrAbove LineNr
  hi! link LineNrBelow LineNr
  hi! link SpecialKey NonText
  hi! link EndOfBuffer NonText
  hi! link CursorColumn CursorLine
  hi! link QuickFixLine CursorLine
  hi! link Terminal Normal
  hi! link StatuslineTerm Statusline
  hi! link StatuslineTermNC StatuslineNC
  hi! link TabLineFill TabLine
  if &background ==# 'dark'
    hi Normal ctermfg=250 ctermbg=235 cterm=NONE
    if !has('patch-8.0.0616') " Fix for Vim bug
      set background=dark
    endif
...

image

@lifepillar, do you think you would remove it at some point or should we amend check_colors itself?

@romainl fyi.

lifepillar commented 2 years ago

That code is for backward compatibility: it doesn't make sense for color schemes that are included with recent Vim. I do not plan to retain it for v3, but for now I may just add a setting to skip it.

lifepillar commented 2 years ago

FYI, this is the bug mentioned in the comment: https://groups.google.com/g/vim_dev/c/afPqwAFNdrU/m/nqh6tOM87QUJ.

lifepillar commented 2 years ago

Colortemplate's master has a new setting to fix this. Just set g:colortemplate_backward_compatibility=0 or add a declaration Colortemplate Options: backward_compatibility=0 in the template.

romainl commented 2 years ago

That background option has been causing so much confusion…

Thank you @lifepillar.

lifepillar commented 2 years ago

should we amend check_colors

No, I think that check_colors should complain about that.

The code Colortemplate generates (only under pretty specific circumstances—see check_bug_bg234() in Colortemplate's source if you are curious) is a hack to work around the above mentioned bug, as I didn't find a better way.

habamax commented 2 years ago

Thx @lifepillar!