Shougo / neosnippet.vim

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

Deoplete `converter_auto_paren` causes neosnippet expand wrong #494

Closed amikai closed 4 years ago

amikai commented 4 years ago

Problems summary

See the picture. After converter_auto_paren is set, the snippet which ends with ( will expands wrong. See the picture: When expand func(, the result is ffunc. When expand echomsg(, the result is eechomsg kkk

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 {.line-numbers}

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('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
    call deoplete#custom#source('_', 'converters', ['converter_auto_paren'])
    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()))
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 the [ns] candidate which end with (

Shougo commented 4 years ago

Please upload the correct information. You have edit test.vim file instead of go file in the screenshot. And you have not uploaded the snippet file. It is hard to reproduce for me. Can I close the issue?

Shougo commented 4 years ago

It is not reproduce-able for me. I will upload the vimrc and instruction. I will close non-reproduce-able issue.

Shougo commented 4 years ago

Hm. Reproduced

amikai commented 4 years ago

Please upload the correct information. You have edit test.vim file instead of go file in the screenshot.

This is another vimrc. The minimal vimrc doesn't use vim-go plugin. The problem occured when snippet candidate end with (, not just vim file

And you have not uploaded the snippet file.

I only use these snippets.

let g:neosnippet#snippets_directory = expand(s:dein_repo_dir.'/repos/github.com/Shougo/neosnippet-snippets/neosnippets')

It is hard to reproduce for me. Can I close the issue?

Sorry for my poor English. It make you hard to reproduce it.

Shougo commented 4 years ago

I get the reason. I will fix it later.

amikai commented 4 years ago

THX

Shougo commented 4 years ago

Fixed.