Improve eval behavior

This commit is contained in:
Shougo Matsushita 2017-09-18 21:21:04 +09:00
parent 5bf290f923
commit c86a19b06a

View File

@ -531,9 +531,7 @@ function! s:eval_snippet(snippet_text) abort "{{{
let prev_match = matchend(a:snippet_text, let prev_match = matchend(a:snippet_text,
\ '\\\@<!`.\{-}\\\@<!`', match) \ '\\\@<!`.\{-}\\\@<!`', match)
let expr = a:snippet_text[match+1 : prev_match - 2] let expr = a:snippet_text[match+1 : prev_match - 2]
if expr != '' let snip_word .= (expr == '' ? '`' : eval(expr))
let snip_word .= eval(expr)
endif
let match = match(a:snippet_text, '\\\@<!`.\{-}\\\@<!`', prev_match) let match = match(a:snippet_text, '\\\@<!`.\{-}\\\@<!`', prev_match)
endwhile endwhile