albertorestifo / github.vim

A GitHub colors scheme for neovim/gvim/vim
MIT License
37 stars 7 forks source link

Search/IncSearch highlighting clashes with ColorColumn #7

Open UrsaDK opened 7 years ago

UrsaDK commented 7 years ago

Search and/or IncSearch highlighting disappears if the highlighted word happens to be on a ColorColumn.

How to recreate

  1. Start a new buffer and run the following commands:
    :colorscheme github
    :set hlsearch incsearch
    :set colorcolumn=3,4,5
    :normal ggiThisIsMyTest
  2. Search for hisIs (broken IncSearch highlight) then hit Enter (broken Search highlight)

My solution

Normally the way colorschemes get around this issue is by setting gui=reverse cterm=reverse on both IncSearch and Search highlight groups. However, doing so here results in a pale text on a pale background when the highlighted characters are on the ColorColumn. This makes the text ineligible. It also resets the foreground colour of the text inside the highlight, which isn't ideal...

Personally, I decided to fix this issue by taking a clue from GitHub and disabling ColorColumn highlighting all together: hi clear ColorColumn. After all, GitHub doesn't support ColorColumn so by not coloring them in the theme stays true to GitHub's visual styling.

However, this solution might not be to everyone's taste.

albertorestifo commented 7 years ago

Personally I'm against the idea of styling the ColorColumn as invisible: a theme should not force an editor feature to be unusable IMO.

I'll try the reverse trick :+1:

UrsaDK commented 7 years ago

I see your point and I totally agree with "a theme should not force an editor feature to be unusable", but in this case I just couldn't find a better solution... though, I didn't try long. ;)

Let me know if there is anything I can do to help.

albertorestifo commented 6 years ago

I did a full rewrite of the package, can you check if this issue is happening still?

UrsaDK commented 6 years ago

Thanks @albertorestifo! I'll give it a go but it might take me a few days.