autozimu / LanguageClient-neovim

Language Server Protocol (LSP) support for vim and neovim.
MIT License
3.55k stars 273 forks source link

Hover window disables syntax highlight. #1083

Closed vext01 closed 4 years ago

vext01 commented 4 years ago

Describe the bug

Hovering window produced by K binding disables syntax highlighting.

Environment

To Reproduce

Steps to reproduce the behavior:

if empty(glob('~/.vim/autoload/plug.vim'))
    silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
                \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
    autocmd VimEnter * PlugInstall | source $MYVIMRC
endif

syntax on

call plug#begin('~/.vim/plugged')
Plug 'autozimu/LanguageClient-neovim', {
    \ 'branch': 'next',
    \ 'do': 'bash install.sh',
    \ }
call plug#end()

set hidden
if executable('rust-analyzer')
    let g:LanguageClient_serverCommands = {
            \ 'rust': ['rust-analyzer'],
    \ }
endif

nmap <silent>K <Plug>(lcn-hover)

Hover window appears, text in the buffer behind is no longer syntax highlighted(!).

Screenshots

image

image

Can anyone repro, or just me?

FWIW, I had the same issue with hovering windows using vim-lsp.

vext01 commented 4 years ago

This turned out to be due to a syntax off in ~/.vim/ftplugin/markdown.vim.