matsui54 / ddc-nvim-lsp-doc

Shows completion documentation and signature help from nvim-lsp.
MIT License
21 stars 2 forks source link

Incorrect syntax highlighting in preview window with vimtex plugin #7

Closed krisfans closed 3 years ago

krisfans commented 3 years ago

Thank you for your work. While writing latex , I found that the plugin does not display Vsnip code correctly in the floating window when vimtex is loaded

minimal.vim

if &compatible
    set nocompatible               " Be iMproved
endif
set runtimepath+=~/.cache/nvim/dein/repos/github.com/Shougo/dein.vim
let s:dein_path = $HOME . '/.cache/nvim/dein'
let g:dein#auto_recache = 1
call dein#begin(s:dein_path)
call dein#add('~/.cache/nvim/dein/repos/github.com/Shougo/dein.vim')
call dein#add('vim-denops/denops.vim')
call dein#add('Shougo/ddc.vim')
call dein#add('Shougo/ddc-matcher_head')
call dein#add('Shougo/ddc-sorter_rank')
call dein#add('Shougo/ddc-nvim-lsp')
call dein#add('matsui54/ddc-nvim-lsp-doc')
call dein#add('lervag/vimtex')
call dein#add('neovim/nvim-lspconfig')
call dein#add('hrsh7th/vim-vsnip')
call dein#add('hrsh7th/vim-vsnip-integ')
call dein#add('rafamadriz/friendly-snippets')
call dein#end()
call dein#call_hook('source')
call dein#call_hook('post_source')
" Required:
filetype plugin indent on
syntax enable
set background=light

call ddc#custom#patch_global('sources',
    \ [ 'nvim-lsp','vsnip'],
    \ )
call ddc#custom#patch_global('sourceOptions', {
    \ '_': {
    \   'ignoreCase': v:true,
    \   'matchers': ['matcher_head'],
    \   'sorters': ['sorter_rank'],
    \ },
    \ 'nvim-lsp': {
    \   'mark': 'LSP',
    \   'isVolatile': v:true,
    \   'minAutoCompleteLength': 1,
    \   'forceCompletionPattern': '\.\w*|:\w*|->\w*|\\\w*'
    \ },
    \ 'vsnip': {
    \   'mark': 'Vsnip',
    \   'dup': v:true
    \ },
    \ })

" autocmd CompleteDone * silent! pclose!
call ddc#enable()
call ddc_nvim_lsp_doc#enable()
autocmd BufRead,BufNewFile *.tex set filetype=tex
" autocmd FileType tex set syn=tex
set completeopt-=preview
lua << EOF
    require'lspconfig'.clangd.setup{}
    require'lspconfig'.texlab.setup{}
EOF

Steps to Reproduce

  1. nvim -u minimal.vim test.tex
  2. type \fig

    screenshot

    Snipaste_2021-09-30_08-16-21

matsui54 commented 3 years ago

Though this doesn't completely solve the problem, the appearance would be improved.