Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thekaganugur opened this issue Oct 24, 2020 · 5 comments
Open

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

thekaganugur opened this issue Oct 24, 2020 · 5 comments

Comments

@thekaganugur
Copy link

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

  • terminal: iTerm2 3.3.12
  • vim/nvim version:NVIM v0.4.4

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

neoclide/coc.nvim#1248
joshdick/onedark.vim#197 (comment)
scalameta/coc-metals#309

@lifepillar
Copy link
Owner

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
Copy link
Author

thekaganugur commented Oct 24, 2020

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

image

@lifepillar
Copy link
Owner

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
Copy link

tkolleh commented Nov 25, 2020

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
Copy link

yudai0804 commented Sep 17, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants