简体   繁体   中英

Colorscheme broken after upgrading to nvim v0.8.0, why did t_Co change?

Today I've upgraded from neovim 0.7.2 to 0.8.0 and my color scheme broke. It seems that some of the colors are okay and some of them are not.

I'm using this color scheme: https://github.com/arzg/vim-colors-xcode/blob/master/colors/xcodelighthc.vim

here is output of the :highlight command:

The strange thing is that I have this color for example defined in my color scheme that I'm using:

hi Pmenu guifg=#000000 guibg=#f4f4f4 gui=NONE cterm=NONE

but the highlight command shows that

Pmenu xxx ctermfg=0 ctermbg=225 guibg=LightMagenta

guibg=#f4f4f4 vs guibg=LightMagenta

I've checked the changelog for breaking changes regarding colorscheme but I found nothing.

It seems that this weird behaviour is caused by this if statement

let s:t_Co = exists('&t_Co') && !empty(&t_Co) && &t_Co > 1 ? &t_Co : 2
if s:t_Co >= 256

Line: https://github.com/arzg/vim-colors-xcode/blob/master/colors/xcodelighthc.vim#L372

After the update s:t_Co >= 256 evaluates to false and because of that it's not applying the colors correctly.

git bisect told me that neovim broke backward compatibility for exists('&t_Co') in PR #20375 . After that commit was merged, the return value of exists('&t_Co') changed from 1 to 0, and even built-in color schemes were also affected .

Edit: I've reported this issue at #21499 as this change also broke my color schemes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM