roxma/nvim-completion-manager

Completion shows part of the snippet

Opened this issue · 1 comments

The following gif explains my problem best:
completion

When I go through the list of available completions I will always see part of the snippet code in the buffer. As soon as I press the completion keys, UltiSnips is triggered correctly, though. This is kind of annoying if I don’t want to use snippets in some situations. Is this a known issue? Anything I’m doing wrong here?

I use neovim v0.2.2 on Linux with the cquery language server. All plugins are up to date. I can reproduce the issue with the following minimal init.vim:

call plug#begin('~/.local/share/nvim/plugged')
Plug 'autozimu/LanguageClient-neovim', {
    \ 'branch': 'next',
    \ 'do': 'bash install.sh',
    \ }
Plug 'roxma/nvim-completion-manager'
Plug 'SirVer/ultisnips'
call plug#end()


let g:UltiSnipsSnippetsDir = $HOME."/.config/nvim/UltiSnips/"
let g:UltiSnipsJumpForwardTrigger = "<C-J>"
let g:UltiSnipsJumpBackwardTrigger = "<C-K>"

let g:UltiSnipsExpandTrigger = "<Plug>(ultisnips_expand)"
inoremap <silent> <c-j> <c-r>=cm#sources#ultisnips#trigger_or_popup("\<Plug>(ultisnips_expand)")<cr>


inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <CR> (pumvisible() ? "\<c-y>\<cr>" : "\<CR>")


let g:LanguageClient_settingsPath = $HOME.'/.config/nvim/settings.json'
let g:LanguageClient_serverCommands = { 'cpp': ['cquery', '--language-server'] }
let g:LanguageClient_loadSettings = 1

The following change fixes the problem, but I have no idea if this is really the right way to do it:
MichaelWJung@6733f39