Shougo / neosnippet.vim

neo-snippet plugin
Other
1.12k stars 108 forks source link

vim-go with deoplete and neosnippet complete function failed #493

Closed amikai closed 4 years ago

amikai commented 4 years ago

Problems summary

See the picture. When deoplete auto-complete function. The error occurred eofv3-3gn0r

Expected

Environment Information

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/local/Cellar/neovim/HEAD-37ee955/share/nvim"


## Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

```vim
let $NVIMRC=fnamemodify(expand('<sfile>'), ':h')
let $CACHE='/tmp'

let s:dein_dir = expand('$CACHE/dein')

if &runtimepath !~# '/dein.vim'
    let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'

    " Auto Download
    if !isdirectory(s:dein_repo_dir)
        execute '!git clone https://github.com/Shougo/dein.vim ' . s:dein_repo_dir
    endif

    execute 'set runtimepath^=' . s:dein_repo_dir
endif

let g:dein#install_max_processes = 16
let g:dein#install_message_type = 'none'

function! s:is_whitespace()
    let col = col('.') - 1
    return ! col || getline('.')[col - 1] =~? '\s'
endfunction

call dein#begin(s:dein_dir)
    call dein#add('fatih/vim-go')
    call dein#add('Shougo/deoplete.nvim')
    call dein#add('Shougo/neosnippet-snippets', {'build': 'UpdateRemotePlugins'})
    call dein#add('Shougo/neosnippet.vim')
    call dein#add('Shougo/dein.vim')
call dein#end()
filetype plugin indent on
syntax enable

function! DeopleteSetting() abort
    echom "deoplete setting"
    call deoplete#custom#option('sources', {
                \ 'go' :['omni', 'neosnippet']
                \})

    call deoplete#custom#var('omni', 'input_patterns', {
                \ 'go' : '[^. *\t]\.\w*'
                \})

    call deoplete#custom#source('omni', 'functions', {
                \ 'go': ['go', 'go#complete#Complete'],
                \})
    imap <silent><expr><Tab> pumvisible() ? "\<Down>"
                \ : (neosnippet#jumpable() ? "\<Plug>(neosnippet_jump)"
                \ : (<SID>is_whitespace() ? "\<Tab>"
                \ : deoplete#manual_complete()))

    smap <silent><expr><Tab> pumvisible() ? "\<Down>"
                \ : (neosnippet#jumpable() ? "\<Plug>(neosnippet_jump)"
                \ : (<SID>is_whitespace() ? "\<Tab>"
                \ : deoplete#manual_complete()))

    inoremap <expr><S-Tab>  pumvisible() ? "\<Up>" : "\<C-h>"
endfunction

let g:deoplete#enable_at_startup = 1
" neosnippet
let g:neosnippet#enable_snipmate_compatibility = 1
let g:neosnippet#enable_completed_snippet = 1
let g:neosnippet#expand_word_boundary = 1
let g:neosnippet#enable_complete_done = 1
let g:neosnippet#snippets_directory = expand(s:dein_repo_dir.'/repos/github.com/Shougo/neosnippet-snippets/neosnippets')

call DeopleteSetting()

if has('vim_starting') && dein#check_install()
    call dein#install()
endif
" vim: set foldmethod=marker tw=80 sw=4 ts=4 sts =4 sta nowrap et :

How to reproduce the problem from neovim/Vim startup (Required!)

Step1. Use my minimal vimrc. Step2. Edit the go file. Step3. Select candidate by <Tab> Step4. Select function candidate

Shougo commented 4 years ago

Really newest??

Please upload deoplete sha1 and neosnippet sha1. I think the problem is already fixed.

Please see this. https://github.com/Shougo/echodoc.vim/issues/87

Shougo commented 4 years ago

I get the reason from the error message. Fixed.

amikai commented 4 years ago

Thanks