Delete InsertLeave event
This commit is contained in:
parent
38a24ec1db
commit
e5b90773b2
@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: init.vim
|
" FILE: init.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
||||||
" Last Modified: 21 Nov 2013.
|
" Last Modified: 25 Dec 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
|
||||||
@ -84,7 +84,6 @@ function! s:initialize_others() "{{{
|
|||||||
\ call neosnippet#variables#set_snippets({})
|
\ call neosnippet#variables#set_snippets({})
|
||||||
autocmd BufEnter *
|
autocmd BufEnter *
|
||||||
\ call neosnippet#mappings#_clear_select_mode_mappings()
|
\ call neosnippet#mappings#_clear_select_mode_mappings()
|
||||||
autocmd InsertLeave * call neosnippet#view#_on_insert_leave()
|
|
||||||
augroup END"}}}
|
augroup END"}}}
|
||||||
|
|
||||||
augroup neosnippet
|
augroup neosnippet
|
||||||
|
@ -166,22 +166,6 @@ function! neosnippet#view#_jump(cur_text, col) "{{{
|
|||||||
return s:search_outof_range(a:col)
|
return s:search_outof_range(a:col)
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
function! neosnippet#view#_on_insert_leave() "{{{
|
|
||||||
let expand_stack = neosnippet#variables#expand_stack()
|
|
||||||
|
|
||||||
" Get patterns and count.
|
|
||||||
if empty(expand_stack)
|
|
||||||
\ || neosnippet#variables#current_neosnippet().trigger
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
if expand_stack[-1].begin_line != expand_stack[-1].end_line
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
call neosnippet#commands#_clear_markers()
|
|
||||||
endfunction"}}}
|
|
||||||
|
|
||||||
function! s:indent_snippet(begin, end) "{{{
|
function! s:indent_snippet(begin, end) "{{{
|
||||||
if a:begin > a:end
|
if a:begin > a:end
|
||||||
return
|
return
|
||||||
|
@ -638,9 +638,6 @@ insert empty line in snippet end, you must insert placeholder.
|
|||||||
|
|
||||||
|
|
||||||
<
|
<
|
||||||
Note: If you expand oneline snippet, the markers will be deleted in
|
|
||||||
|InsertLeave|.
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
UNITE SOURCES *neosnippet-unite-sources*
|
UNITE SOURCES *neosnippet-unite-sources*
|
||||||
|
|
||||||
@ -729,9 +726,10 @@ Q: I want to add snippets dynamically.
|
|||||||
|
|
||||||
A: You can use |:NeoSnippetSource| for it.
|
A: You can use |:NeoSnippetSource| for it.
|
||||||
|
|
||||||
Q: I want to delete markers in multiline snippet.
|
Q: I want to delete markers when InsertLeave event.
|
||||||
|
|
||||||
A: You can use |:NeoSnippetClearMarkers| command.
|
A: You can use |:NeoSnippetClearMarkers| command. >
|
||||||
|
autocmd InsertLeave * NeoSnippetClearMarkers
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
vim:tw=78:ts=8:ft=help:norl:noet:fen:noet:
|
vim:tw=78:ts=8:ft=help:norl:noet:fen:noet:
|
||||||
|
Loading…
Reference in New Issue
Block a user