- Added unite__new_candidate action in snippet source.

This commit is contained in:
Shougo Matsushita 2012-10-18 12:28:51 +09:00
parent 97b0a2a246
commit befa939da6
2 changed files with 25 additions and 0 deletions

View File

@ -114,6 +114,30 @@ function! s:action_table.preview.func(candidates)"{{{
endfor
endfunction"}}}
let s:action_table.unite__new_candidate = {
\ 'description' : 'add new snippet',
\ 'is_quit' : 1,
\ }
function! s:action_table.unite__new_candidate.func(candidate)"{{{
call unite#take_action('open', a:candidate)
if &filetype != 'snippet'
" Open failed.
return
endif
if getline('$') != ''
" Append line.
call append('$', '')
endif
call append('$', ['snippet ', 'abbr ',
\ "prev_word '^'", ' '])
call cursor(line('$') - 3, 0)
call cursor(0, col('$'))
endfunction"}}}
let s:source.action_table = s:action_table
unlet! s:action_table
"}}}

View File

@ -419,6 +419,7 @@ CHANGELOG *neosnippet-changelog*
- Fixed alias problem.
- Improved escape placeholder.
- Fixed s:get_sources_list().
- Added unite__new_candidate action in snippet source.
2012-10-15
- Improved lua snip.