- Added unite__new_candidate action in snippet source.
This commit is contained in:
parent
97b0a2a246
commit
befa939da6
@ -114,6 +114,30 @@ function! s:action_table.preview.func(candidates)"{{{
|
|||||||
endfor
|
endfor
|
||||||
endfunction"}}}
|
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
|
let s:source.action_table = s:action_table
|
||||||
unlet! s:action_table
|
unlet! s:action_table
|
||||||
"}}}
|
"}}}
|
||||||
|
@ -419,6 +419,7 @@ CHANGELOG *neosnippet-changelog*
|
|||||||
- Fixed alias problem.
|
- Fixed alias problem.
|
||||||
- Improved escape placeholder.
|
- Improved escape placeholder.
|
||||||
- Fixed s:get_sources_list().
|
- Fixed s:get_sources_list().
|
||||||
|
- Added unite__new_candidate action in snippet source.
|
||||||
|
|
||||||
2012-10-15
|
2012-10-15
|
||||||
- Improved lua snip.
|
- Improved lua snip.
|
||||||
|
Loading…
Reference in New Issue
Block a user