- Improved stopinsert.
This commit is contained in:
parent
293332348e
commit
db72ae6771
@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: neosnippet.vim
|
" FILE: neosnippet.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
||||||
" Last Modified: 11 Jul 2013.
|
" Last Modified: 12 Jul 2013.
|
||||||
" License: MIT license {{{
|
" License: MIT license {{{
|
||||||
" Permission is hereby granted, free of charge, to any person obtaining
|
" Permission is hereby granted, free of charge, to any person obtaining
|
||||||
" a copy of this software and associated documentation files (the
|
" a copy of this software and associated documentation files (the
|
||||||
@ -1283,17 +1283,25 @@ function! s:on_insert_leave() "{{{
|
|||||||
\ expand_info.end_patterns)
|
\ expand_info.end_patterns)
|
||||||
|
|
||||||
let pos = getpos('.')
|
let pos = getpos('.')
|
||||||
|
|
||||||
|
" Found snippet.
|
||||||
|
let found = 0
|
||||||
try
|
try
|
||||||
while s:search_snippet_range(begin, end, expand_info.holder_cnt, 0)
|
while s:search_snippet_range(begin, end, expand_info.holder_cnt, 0)
|
||||||
" Next count.
|
" Next count.
|
||||||
let expand_info.holder_cnt += 1
|
let expand_info.holder_cnt += 1
|
||||||
|
let found = 1
|
||||||
endwhile
|
endwhile
|
||||||
|
|
||||||
" Search placeholder 0.
|
" Search placeholder 0.
|
||||||
call s:search_snippet_range(begin, end, 0)
|
if s:search_snippet_range(begin, end, 0)
|
||||||
|
let found = 1
|
||||||
|
endif
|
||||||
finally
|
finally
|
||||||
|
if found
|
||||||
stopinsert
|
stopinsert
|
||||||
|
endif
|
||||||
|
|
||||||
call setpos('.', pos)
|
call setpos('.', pos)
|
||||||
endtry
|
endtry
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
Loading…
Reference in New Issue
Block a user