Closed hliebert closed 6 years ago
+1
Same for me. The errors started appearing after upgrading from Vim 8.0.1436 to 8.0.1476. Seems like v:completed_item
variable is now fully read-only. This works in Neovim 0.2.2 but not in the latest Vim:
let v:completed_item.snippet = "foo"
nvim-completion-manager should use user_data feature instead.
The ugly fix in PR #200 works for me with vim + ultisnips. Neosnippets and Snipmates are not tested.
I'm having this issue as well. Is this going to be fixed anytime soon? It's a deal breaker!
@roxma, are you going to accept JR4er PR?
@qazip you can use my fork JR4er/nvim-completion-manager as a temporary solution until a better fix is provided or the PR is accepted. (my fork will be removed then)
@JR4er , sadly your fork doesn't seem to work with vim-Plug. I'll have to find another way to install it. thanks!
@qazip I use vim-Plug too. Plug 'JR4er/nvim-completion-manager'
works for me.
@JR4er, I was missing PlugClean, my bad. Though there seems to be an error now, when opening gvim: http://i.imgur.com/yocvqfC.png
Probably due to using vim-hug-neovim-rpc?
@qazip likely. You still need to install roxma/vim-hug-neovim-rpc
and use pip
to install neovim
python-client, see the Installation section in README.md
@JR4er, I did install that. It works fine in vim, in GVim it gives the error I showed you.
😢
Actually you can just not rely NCM to do the snip complete for you, for exmaple, I have these code in my .vimrc:
" improved ultisnip complete {{
inoremap <C-l> <C-R>=SnipComplete()<CR>
func! SnipComplete()
let line = getline('.')
let start = col('.') - 1
while start > 0 && line[start - 1] =~# '\k'
let start -= 1
endwhile
let suggestions = []
let snips = UltiSnips#SnippetsInCurrentScope(0)
for item in snips
let trigger = item.key
let entry = {'word': item.key, 'menu': item.description}
call add(suggestions, entry)
endfor
if empty(suggestions)
echohl Error | echon 'no match' | echohl None
elseif len(suggestions) == 1
let pos = getcurpos()
if start == 0
let str = trigger
else
let str = line[0:start - 1] . trigger
endif
call setline('.', str)
let pos[2] = len(str) + 1
call setpos('.', pos)
call UltiSnips#ExpandSnippet()
else
call complete(start + 1, suggestions)
endif
return ''
endfunc
" }}
And I can just don't use NCM as well, but that's not an option. :) I don't want to maintain hacks and workarounds, and it's pity that @roxma don't have enough time to work on this.
ncm2 fixes this issue. use ncm2 instead http://github.com/ncm2/ncm2
I've been getting the following error for about a week when selecting a snippet, both in Latex and R. I'm using UltiSnips together with nvim-completion-manager in Vim 8 on Linux.
The culprit seems to be
let g:UltiSnipsExpandTrigger = "<Plug>(ultisnips_expand)"