Improve snipMate compatibility init
This commit is contained in:
parent
7b1f900912
commit
4f35262ae1
@ -771,20 +771,6 @@ function! s:skip_next_auto_completion() "{{{
|
||||
let neosnippet.trigger = 0
|
||||
endfunction"}}}
|
||||
|
||||
if g:neosnippet#enable_snipmate_compatibility
|
||||
" For snipMate function.
|
||||
function! Filename(...)
|
||||
let filename = expand('%:t:r')
|
||||
if filename == ''
|
||||
return a:0 == 2 ? a:2 : ''
|
||||
elseif a:0 == 0 || a:1 == ''
|
||||
return filename
|
||||
else
|
||||
return substitute(a:1, '$1', filename, 'g')
|
||||
endif
|
||||
endfunction
|
||||
endif
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
|
@ -113,6 +113,20 @@ function! s:initialize_others() "{{{
|
||||
endif
|
||||
|
||||
call neosnippet#mappings#_clear_select_mode_mappings()
|
||||
|
||||
if g:neosnippet#enable_snipmate_compatibility "{{{
|
||||
" For snipMate function.
|
||||
function! Filename(...)
|
||||
let filename = expand('%:t:r')
|
||||
if filename == ''
|
||||
return a:0 == 2 ? a:2 : ''
|
||||
elseif a:0 == 0 || a:1 == ''
|
||||
return filename
|
||||
else
|
||||
return substitute(a:1, '$1', filename, 'g')
|
||||
endif
|
||||
endfunction
|
||||
endif"}}}
|
||||
endfunction"}}}
|
||||
|
||||
function! s:on_insert_leave() "{{{
|
||||
|
Loading…
Reference in New Issue
Block a user