From affc71bd9f1e19f5092c69c6f04c618b78324a36 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sat, 1 Apr 2017 10:23:58 +0900 Subject: [PATCH] Fix #379 snippet parse --- autoload/neosnippet.vim | 8 ++++---- autoload/neosnippet/view.vim | 14 +++++--------- syntax/neosnippet.vim | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index 7629d2a..64a49df 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -81,19 +81,19 @@ endfunction"}}} " Get marker patterns. function! neosnippet#get_placeholder_target_marker_pattern() abort "{{{ - return '\${\d\+:\(#:\)\?TARGET\%(:.\{-}\)\?\\\@' endfunction"}}} function! neosnippet#get_placeholder_marker_substitute_pattern() abort "{{{ - return '\${\(\d\+\%(:.\{-}\)\?\\\@' diff --git a/autoload/neosnippet/view.vim b/autoload/neosnippet/view.vim index e0ec121..1141d4c 100644 --- a/autoload/neosnippet/view.vim +++ b/autoload/neosnippet/view.vim @@ -58,20 +58,16 @@ function! neosnippet#view#_insert(snippet, options, cur_text, col) abort "{{{ let snip_word = s:eval_snippet(snip_word) endif - " Substitute escaped `. - let snip_word = substitute(snip_word, '\\`', '`', 'g') - " Substitute markers. let snip_word = substitute(snip_word, - \ '\\\@', 'g') let snip_word = substitute(snip_word, - \ '\\\@', 'g') - let snip_word = substitute(snip_word, - \ '\\'.neosnippet#get_mirror_placeholder_marker_substitute_pattern().'\|'. - \ '\\'.neosnippet#get_placeholder_marker_substitute_pattern(), - \ '\=submatch(0)[1:]', 'g') + + " Substitute escaped characters. + let snip_word = substitute(snip_word, '\\\\', '\\', 'g') " Insert snippets. let next_line = getline('.')[a:col-1 :] diff --git a/syntax/neosnippet.vim b/syntax/neosnippet.vim index 8854a5c..166e94b 100644 --- a/syntax/neosnippet.vim +++ b/syntax/neosnippet.vim @@ -42,7 +42,7 @@ syntax match neosnippetWord \ '^\s\+.*$' contains= \neosnippetEval,neosnippetPlaceHolder,neosnippetEscape,neosnippetVariable syntax match neosnippetPlaceHolder - \ '\\\@