- Improved unite__new_candidate action.
This commit is contained in:
parent
befa939da6
commit
ae1c34cdfa
@ -119,6 +119,12 @@ let s:action_table.unite__new_candidate = {
|
|||||||
\ 'is_quit' : 1,
|
\ 'is_quit' : 1,
|
||||||
\ }
|
\ }
|
||||||
function! s:action_table.unite__new_candidate.func(candidate)"{{{
|
function! s:action_table.unite__new_candidate.func(candidate)"{{{
|
||||||
|
let trigger = unite#util#input('Please input snippet trigger: ')
|
||||||
|
if trigger == ''
|
||||||
|
echo 'Canceled.'
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
call unite#take_action('open', a:candidate)
|
call unite#take_action('open', a:candidate)
|
||||||
if &filetype != 'snippet'
|
if &filetype != 'snippet'
|
||||||
" Open failed.
|
" Open failed.
|
||||||
@ -130,10 +136,10 @@ function! s:action_table.unite__new_candidate.func(candidate)"{{{
|
|||||||
call append('$', '')
|
call append('$', '')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call append('$', ['snippet ', 'abbr ',
|
call append('$', ['snippet ' . trigger, 'abbr ' . trigger,
|
||||||
\ "prev_word '^'", ' '])
|
\ "prev_word '^'", ' '])
|
||||||
|
|
||||||
call cursor(line('$') - 3, 0)
|
call cursor(line('$'), 0)
|
||||||
call cursor(0, col('$'))
|
call cursor(0, col('$'))
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user