lifepillar / vim-solarized8

Optimized Solarized colorschemes. Best served with true-color terminals!
1.01k stars 92 forks source link

Weird highlight of the "brackets" in floating window #86

Open thekaganugur opened 4 years ago

thekaganugur commented 4 years ago

Problems summary

I'm using CoC, when I hover to get documentation via float window, the parentheses background color is weird as need in screenshots.

Expected

Proper background color for parentheses on the floating window.

Environment Information

Minimal vim rc

call plug#begin('~/.nvim/plugged')
  Plug 'neoclide/coc.nvim', {'branch': 'release'}
  Plug 'sheerun/vim-polyglot'
  Plug 'lifepillar/vim-solarized8'
call plug#end()

set termguicolors
set background=light
colorscheme solarized8_flat

" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>

function! s:show_documentation()
  if (index(['vim','help'], &filetype) >= 0)
    execute 'h '.expand('<cword>')
  elseif (coc#rpc#ready())
    call CocActionAsync('doHover')
  else
    execute '!' . &keywordprg . " " . expand('<cword>')
  endif
endfunction

The reproduce ways from neovim

  1. Install dependecys
  2. Write console.log() inside an JS/TS file
  3. How with 'K' over log

Screen shot

image

Related

https://github.com/neoclide/coc.nvim/issues/1248 https://github.com/joshdick/onedark.vim/issues/197#issuecomment-574422967 https://github.com/scalameta/coc-metals/issues/309

lifepillar commented 4 years ago

On a cursory read through the links you have posted, this appears to me like a coc.nvim issue. If I have understood correctly, the delimiters are highlighted with Normal. What happens if you set:

let g:solarized_termtrans=1

and reload the color scheme? With that option the Normal's background is not set, so the background will inherit your terminal's background. Does that also fix your issue?

thekaganugur commented 4 years ago

Sorry, nothing changed. Disabling syntax highlighting on floating windows fixes the issue if this will give you a clue.

image

lifepillar commented 4 years ago

That's strange. I have seen two proposed solutions to the issue. The first is to override Normal after loading the color scheme, using an autocommand:

autocmd Colorscheme solarized8_flat hi Normal guifg=#657b83 ctermfg=66 guibg=NONE ctermbg=NONE

But if setting g:solarized_termtrans didn't fix it, I doubt that the above will do.

Elsewhere, I have seen people override a Quote highlight group instead. So, you might also try:

autocmd Colorscheme solarized8_flat hi Quote guifg=#657b83 ctermfg=66 guibg=NONE ctermbg=NONE

I cannot reproduce this right now, because I don't use none of Neovim, Plug, coc.nvim, etc. I'll try to set up a test environment when possible.

tkolleh commented 4 years ago

I am seeing red highlights in floating menus not sure if this is related to this issue:

Screen Shot 2020-11-16 at 9 46 15 PM Screen Shot 2020-11-23 at 7 11 00 PM

How would I go about changing the floating menu to solarized dark colors or a simple white background. I'd prefer more contrast to make it easier to read floating menus.

Version details...Click to expand! ``` NVIM v0.5.0-nightly-246-g7caa622af Build type: Release LuaJIT 2.0.5 ``` Packages which trigger completion: ``` call minpac#add('neovim/nvim-lspconfig', {'type': 'start'}) call minpac#add('nvim-treesitter/nvim-treesitter', {'type': 'start', 'do': 'TSUpdate'}) ``` Screen Shot 2020-11-24 at 8 36 28 PM
yudai0804 commented 1 year ago

On a cursory read through the links you have posted, this appears to me like a coc.nvim issue. If I have understood correctly, the delimiters are highlighted with Normal. What happens if you set:

let g:solarized_termtrans=1

and reload the color scheme? With that option the Normal's background is not set, so the background will inherit your terminal's background. Does that also fix your issue?

I had the same problem, but I did the method you suggested and the problem was solved. Thank you very much. By the way, I was using Vim 8.2