junegunn / limelight.vim

:flashlight: All the world's indeed a stage and we are merely players
MIT License
2.36k stars 54 forks source link

Not working on Neovim #33

Closed taq closed 8 years ago

taq commented 8 years ago

I just got an error when running this plugin on Neovim. Seems that there is an error on the hex2rgb function, because is not send an hex value there. I forced synIDattr to use the gui mode (last parameter) and the error stopped, but I still can't have the dimmed parts of the code.

taq commented 8 years ago

Hello? :-)

junegunn commented 8 years ago

The error only occurs when termguicolors is set. But it works fine on regular Vim with the option.

colo seoul256
echo synIDattr(synIDtrans(hlID('Normal')), 'fg#')
" vim: 252, nvim: 252
set termguicolors
echo synIDattr(synIDtrans(hlID('Normal')), 'fg#')
" vim: #d9d9d9, nvim: 252

@justinmk Any idea why I see different results?

taq commented 8 years ago

Maybe is Neovim returning it wrong?

taq commented 8 years ago

Does regular Vim has the set termguicolors?

junegunn commented 8 years ago

Yes. https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162

justinmk commented 8 years ago

@junegunn @taq What version of Neovim ? There was a patch related to this not long ago.

https://github.com/neovim/neovim/pull/4851

taq commented 8 years ago

I use the latest version from the Neovim PPA. They update it almost every day.

justinmk commented 8 years ago

When are you calling set termguicolors?

nvim --cmd 'set termguicolors' -c "put =synIDattr(synIDtrans(hlID('Normal')), 'fg#')"

Inserts #f8f8f2 for me. set termguicolors must be called during startup (in your vimrc/init.vim), not after. This is a nvim limitation (documented at :help 'termguicolors').

taq commented 8 years ago

I think is on some script or even a color scheme. I'm away from the computer (thanks God I can have some hours off sometimes) but I'll test put it on startup tomorrow and give and answer here.

taq commented 8 years ago

Hey, using set termguicolors on startup worked, thanks!