- Fixed on_insert_leave().

This commit is contained in:
Shougo Matsushita 2013-02-16 21:28:14 +09:00
parent 925c03824d
commit f2f56b5a0f

View File

@ -1005,6 +1005,7 @@ function! neosnippet#get_current_neosnippet() "{{{
\ 'snippets' : {}, \ 'snippets' : {},
\ 'selected_text' : '', \ 'selected_text' : '',
\ 'target' : '', \ 'target' : '',
\ 'trigger' : 0,
\} \}
endif endif
@ -1121,6 +1122,7 @@ function! s:trigger(function) "{{{
" Get selected text. " Get selected text.
let neosnippet = neosnippet#get_current_neosnippet() let neosnippet = neosnippet#get_current_neosnippet()
let neosnippet.trigger = 1
if mode() ==# 's' && neosnippet.selected_text =~ '^#:' if mode() ==# 's' && neosnippet.selected_text =~ '^#:'
let expr .= "a\<BS>" let expr .= "a\<BS>"
endif endif
@ -1236,11 +1238,15 @@ function! s:skip_next_auto_completion() "{{{
if exists('*neocomplcache#skip_next_complete') if exists('*neocomplcache#skip_next_complete')
call neocomplcache#skip_next_complete() call neocomplcache#skip_next_complete()
endif endif
let neosnippet = neosnippet#get_current_neosnippet()
let neosnippet.trigger = 0
endfunction"}}} endfunction"}}}
function! s:on_insert_leave() "{{{ function! s:on_insert_leave() "{{{
" Get patterns and count. " Get patterns and count.
if empty(s:snippets_expand_stack) if empty(s:snippets_expand_stack)
\ || neosnippet#get_current_neosnippet().trigger
return return
endif endif