Fix #317 completed snippet problem
This commit is contained in:
parent
8a13d4a679
commit
57301f8a5d
@ -316,6 +316,12 @@ function! neosnippet#parser#_get_completed_snippet(completed_item) "{{{
|
||||
let cnt = 1
|
||||
let snippet = ''
|
||||
|
||||
if empty(filter(values(pairs), 'stridx(abbr, v:val) > 0'))
|
||||
" Pairs not found pattern
|
||||
let snippet .= '${' . cnt . '}'
|
||||
let cnt += 1
|
||||
endif
|
||||
|
||||
if abbr =~ '<.\+>(.*)'
|
||||
" Add angle analysis
|
||||
let snippet .= '<'
|
||||
|
@ -38,6 +38,11 @@ function! s:suite.get_completed_snippet()
|
||||
\ 'menu' : '', 'info' : ''
|
||||
\ }), ')${1}')
|
||||
|
||||
call s:assert.equals(neosnippet#parser#_get_completed_snippet({
|
||||
\ 'word' : 'foo(', 'abbr' : '',
|
||||
\ 'menu' : '', 'info' : ''
|
||||
\ }), '${1})${2}')
|
||||
|
||||
call s:assert.equals(neosnippet#parser#_get_completed_snippet({
|
||||
\ 'word' : 'foo(', 'abbr' : 'foo(hoge)',
|
||||
\ 'menu' : '', 'info' : ''
|
||||
@ -78,6 +83,11 @@ function! s:suite.get_completed_snippet()
|
||||
\ 'menu' : '', 'info' : ''
|
||||
\ }), '}${1}')
|
||||
|
||||
call s:assert.equals(neosnippet#parser#_get_completed_snippet({
|
||||
\ 'word' : 'foo{', 'abbr' : 'foo{',
|
||||
\ 'menu' : '', 'info' : ''
|
||||
\ }), '${1}}${2}')
|
||||
|
||||
call s:assert.equals(neosnippet#parser#_get_completed_snippet({
|
||||
\ 'word' : 'foo{', 'abbr' : 'foo{piyo}',
|
||||
\ 'menu' : '', 'info' : ''
|
||||
|
Loading…
Reference in New Issue
Block a user