Shougo / neosnippet.vim

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

Argument expansion #460

Closed pavlosun closed 5 years ago

pavlosun commented 5 years ago

I am having problem with expansion of arguments. I have C code, GTK project. Everything works and I can complete my function and iterate over arguments as placeholders. There is on thing I think is not working right. As you can see in the attached picture, after the first parameter my comma belongs to the second parameter it results in the following completed function: fun(arg1arg2); but should be: fun(arg1, arg2);

Did I missed something with my config? :checkhealth doesn't show any problem.

My config contains the following settings:

Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'Shougo/neosnippet.vim'
Plug 'Shougo/neosnippet-snippets'
....
inoremap <expr><TAB>  pumvisible() ? "\<C-n>" : "\<TAB>"
" Plugin key-mappings.
" Note: It must be "imap" and "smap".  It uses <Plug> mappings.
imap <C-j>     <Plug>(neosnippet_expand_or_jump)
smap <C-j>     <Plug>(neosnippet_expand_or_jump)
xmap <C-j>     <Plug>(neosnippet_expand_target)

" SuperTab like snippets behavior.
" Note: It must be "imap" and "smap".  It uses <Plug> mappings.

imap <expr><TAB> neosnippet#expandable_or_jumpable() ?
    \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
    \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB

let g:neosnippet#enable_completed_snippet = 1
let g:neosnippet#enable_complete_done = 1
" Enable snipMate compatibility feature.
let g:neosnippet#enable_snipmate_compatibility = 1
" Tell Neosnippet about the other snippets
let g:neosnippet#snippets_directory='~/.config/nvim/mysnippets'

Thanks.

screenshot from 2019-02-08 07-04-21

Shougo commented 5 years ago

It is the feature. , is in the default argument.

Shougo commented 5 years ago

Reason: You may want to skip the comma to use default arguments.

pavlosun commented 5 years ago

I understand this logic for languages such as Python, C++ but for C.... It is kind of confused. Absolutely, the one can adopt to this style but .... Anyway, the issue can be closed if this is a normal behavior. Thanks.