Add neosnippet#complete_done()
This commit is contained in:
parent
7121b95c9e
commit
ef8729c7cc
@ -42,6 +42,10 @@ endfunction
|
||||
function! neosnippet#expand(trigger) abort
|
||||
return neosnippet#mappings#_expand(a:trigger)
|
||||
endfunction
|
||||
function! neosnippet#complete_done() abort
|
||||
return neosnippet#mappings#_complete_done(
|
||||
\ neosnippet#util#get_cur_text(), col('.'))
|
||||
endfunction
|
||||
|
||||
function! neosnippet#get_snippets_directory() abort
|
||||
return neosnippet#helpers#get_snippets_directory()
|
||||
|
@ -140,7 +140,7 @@ function! neosnippet#mappings#_expand(trigger) abort
|
||||
endfunction
|
||||
|
||||
function! s:snippets_expand(cur_text, col) abort
|
||||
if s:expand_completed_snippets(a:cur_text, a:col)
|
||||
if neosnippet#mappings#_complete_done(a:cur_text, a:col)
|
||||
return 0
|
||||
endif
|
||||
|
||||
@ -184,8 +184,13 @@ function! s:get_completed_snippets(cur_text, col) abort
|
||||
|
||||
return []
|
||||
endfunction
|
||||
function! s:expand_completed_snippets(cur_text, col) abort
|
||||
let [cur_text, snippet] = s:get_completed_snippets(a:cur_text, a:col)
|
||||
function! neosnippet#mappings#_complete_done(cur_text, col) abort
|
||||
let ret = s:get_completed_snippets(a:cur_text, a:col)
|
||||
if empty(ret)
|
||||
return 0
|
||||
endif
|
||||
|
||||
let [cur_text, snippet] = ret
|
||||
call neosnippet#view#_insert(snippet, {}, cur_text, a:col)
|
||||
return 1
|
||||
endfunction
|
||||
|
@ -373,6 +373,11 @@ neosnippet#get_snippets_directory()
|
||||
snippets directories and |g:neosnippet#snippets_directory|
|
||||
directories.
|
||||
|
||||
*neosnippet#complete_done()*
|
||||
neosnippet#complete_done()
|
||||
It expands the snippet for |CompleteDone| event.
|
||||
>
|
||||
autocmd CompleteDone * call neosnippet#complete_done()
|
||||
|
||||
==============================================================================
|
||||
EXAMPLES *neosnippet-examples*
|
||||
|
Loading…
Reference in New Issue
Block a user