- Fixed expand snippet.
This commit is contained in:
parent
dc4ad41100
commit
d1831744d6
@ -170,6 +170,14 @@ function! s:set_snippet_dict(snippet_dict, snippets, dup_check, snippets_file)"{
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Substitute word.
|
||||||
|
let a:snippet_dict.word = substitute(a:snippet_dict.word, '\n$', '', '')
|
||||||
|
if a:snippet_dict.word !~
|
||||||
|
\ s:get_placeholder_marker_substitute_pattern()
|
||||||
|
" Add placeholder.
|
||||||
|
let a:snippet_dict.word .= '${0}'
|
||||||
|
endif
|
||||||
|
|
||||||
let action_pattern = '^snippet\s\+' . a:snippet_dict.name . '$'
|
let action_pattern = '^snippet\s\+' . a:snippet_dict.name . '$'
|
||||||
let snippet = s:initialize_snippet(
|
let snippet = s:initialize_snippet(
|
||||||
\ a:snippet_dict, a:snippets_file,
|
\ a:snippet_dict, a:snippets_file,
|
||||||
@ -416,12 +424,6 @@ function! s:parse_snippets_file(snippets, snippets_file)"{{{
|
|||||||
endfor
|
endfor
|
||||||
|
|
||||||
if !empty(snippet_dict)
|
if !empty(snippet_dict)
|
||||||
if snippet_dict.word !~
|
|
||||||
\ s:get_placeholder_marker_substitute_pattern()
|
|
||||||
" Add placeholder.
|
|
||||||
let snippet_dict.word .= '${0}'
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Set previous snippet.
|
" Set previous snippet.
|
||||||
call s:set_snippet_dict(snippet_dict,
|
call s:set_snippet_dict(snippet_dict,
|
||||||
\ a:snippets, dup_check, a:snippets_file)
|
\ a:snippets, dup_check, a:snippets_file)
|
||||||
@ -594,12 +596,6 @@ function! neosnippet#expand(cur_text, col, trigger_name)"{{{
|
|||||||
\ 'holder_cnt' : 1,
|
\ 'holder_cnt' : 1,
|
||||||
\ })
|
\ })
|
||||||
|
|
||||||
if next_line != ''
|
|
||||||
startinsert
|
|
||||||
else
|
|
||||||
startinsert!
|
|
||||||
endif
|
|
||||||
|
|
||||||
if snip_word =~ s:get_placeholder_marker_pattern()
|
if snip_word =~ s:get_placeholder_marker_pattern()
|
||||||
call neosnippet#jump(a:cur_text, a:col)
|
call neosnippet#jump(a:cur_text, a:col)
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user