Search code examples
vim

Vim different DiffAdd on two systems


I have two Vim-s versions with same vimrc:

Linux with PuTTY:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar  7 2020 14:11:31)
Included patches: 1-2367
Huge version without GUI.

Cygwin with mintty:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug  7 2016 16:06:24)
Included patches: 1-2181
Huge version without GUI.

Both have :colorscheme as default, and background=dark.

But :hi for Linux: DiffAdd ... term=bold ctermbg=4, for Cygwin: DiffAdd ... term=bold ctermbg=1. Difference in ctermbg. May be not only these.

I can't find where default scheme set (there is no $VIMRUNTIME/colors/default.vim). I've not found hi set in other vimrc files (/etc/vimrc, $VIMRUNTIME/defaults.vim, etc.). And don't understand what default scheme is.

I have not modified $VIMRUNTIME files, only in $HOME/.vim. Why DiffAdd-s are different?


Solution

  • @romainl, you are right, you've point me right place. I've downloaded vim-7.4.2181-1-src.tar.xz from Cygwin Time Machine and found in it file vim-7.4-syncolor.patch where vim74/src/syntax.c patched by Cygwin:

    diff -up vim74/src/syntax.c.syncolor vim74/src/syntax.c
    --- vim74/src/syntax.c.syncolor 2014-04-16 15:10:30.362287904 +0200
    +++ vim74/src/syntax.c  2014-04-16 15:12:50.278229744 +0200
    @@ -6840,8 +6840,8 @@ static char *(highlight_init_light[]) =
        CENT("Visual term=reverse",
             "Visual term=reverse guibg=LightGrey"),
     #ifdef FEAT_DIFF
    -   CENT("DiffAdd term=bold ctermbg=LightBlue",
    -        "DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue"),
    +   CENT("DiffAdd term=bold ctermbg=LightRed",
    +        "DiffAdd term=bold ctermbg=LightRed guibg=LightBlue"),
        CENT("DiffChange term=bold ctermbg=LightMagenta",
             "DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta"),
        CENT("DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan",
    @@ -6928,8 +6928,8 @@ static char *(highlight_init_dark[]) =
        CENT("Visual term=reverse",
             "Visual term=reverse guibg=DarkGrey"),
     #ifdef FEAT_DIFF
    -   CENT("DiffAdd term=bold ctermbg=DarkBlue",
    -        "DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue"),
    +   CENT("DiffAdd term=bold ctermbg=DarkRed",
    +        "DiffAdd term=bold ctermbg=DarkRed guibg=DarkBlue"),
        CENT("DiffChange term=bold ctermbg=DarkMagenta",
             "DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta"),
        CENT("DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan",
    

    Same result is if find DiffAdd in both binaries, LightBlue (4) and LightRed (1).

    The reason is found. Now I am calmed down. Thank you very much, @romainl!