Fix #363 completed snippet parser

This commit is contained in:
Shougo Matsushita 2017-01-02 10:41:43 +09:00
parent e2d91cba20
commit 65af2b9bca
2 changed files with 5 additions and 1 deletions

View File

@ -417,7 +417,7 @@ function! neosnippet#parser#_get_in_paren(key, pair, str) abort "{{{
continue
endif
elseif c ==# a:pair
if level == 1 && s != ''
if level == 1 && (s != '' || a:str =~ '()\s*(.\{-})')
return s
else
let level -= 1

View File

@ -30,6 +30,10 @@ function! s:suite.get_in_paren() abort
\ '(', ')',
\ 'wait() wait(long, int)'),
\ 'long, int')
call s:assert.equals(neosnippet#parser#_get_in_paren(
\ '(', ')',
\ 'wait() (long, int)'),
\ '')
endfunction
function! s:suite.get_completed_snippet() abort