ncm2 / ncm2-ultisnips

44 stars 3 forks source link

vim-snippets rust only the "trait" snippet incorrectly expands #15

Closed Avi-D-coder closed 5 years ago

Avi-D-coder commented 5 years ago

This is a strange one. Only the trait snippet does not work expanding the trait snippet results in tra.iter().

It started a while back I think when I switched to ncm2 from ncm. Can any one else reproduce this?

roxma commented 5 years ago

I can reprodue the issue without ncm2. This is vim-snippet issue.

set nocompatible
syntax on
filetype plugin indent on
set encoding=utf-8 fileencodings=ucs-bom,utf-8,gbk,gb18030,latin1 termencoding=utf-8

execute 'source ' . $WORKSPACE_DIR . '/plug.vim'

call plug#begin($WORKSPACE_DIR)

    " Plug 'ncm2/ncm2-ultisnips'
    Plug 'SirVer/ultisnips'
    Plug 'honza/vim-snippets'

    " Press enter key to trigger snippet expansion
    " The parameters are the same as `:help feedkeys()`
    inoremap <silent> <expr> <CR> ncm2_ultisnips#expand_or("\<CR>", 'n')

    " c-j c-k for moving in snippet
    let g:UltiSnipsExpandTrigger                = "<tab>"
    let g:UltiSnipsJumpForwardTrigger   = "<c-j>"
    let g:UltiSnipsJumpBackwardTrigger  = "<c-k>"
    let g:UltiSnipsRemoveSelectModeMappings = 0

call plug#end()
roxma commented 5 years ago

You could try remove this snippet: https://github.com/honza/vim-snippets/blob/a6090b9bffeec418ee7deaa31f90c4a8fd3b1170/UltiSnips/rust.snippets#L31

Avi-D-coder commented 5 years ago

Will do. Thank you. I don't know how I missed that.