- Fixed snippet source behavior.

This commit is contained in:
Shougo Matsushita 2012-03-07 08:39:08 +09:00
parent 54b9c1d128
commit c214bafc5b
3 changed files with 9 additions and 5 deletions

View File

@ -1,7 +1,7 @@
"=============================================================================
" FILE: snippets_complete.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 03 Mar 2012.
" Last Modified: 07 Mar 2012.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the

View File

@ -1,7 +1,7 @@
"=============================================================================
" FILE: snippet.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 02 Feb 2012.
" Last Modified: 07 Mar 2012.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@ -53,8 +53,10 @@ let s:source = {
\ }
function! s:source.hooks.on_init(args, context) "{{{
let a:context.source__cur_keyword_pos = s:get_keyword_pos(neocomplcache#get_cur_text(1))
let a:context.source__snippets = sort(values(neocomplcache#sources#snippets_complete#get_snippets()), 's:compare_words')
let a:context.source__cur_keyword_pos =
\ s:get_keyword_pos(neocomplcache#get_cur_text(1))
let a:context.source__snippets =
\ sort(values(neocomplcache#sources#snippets_complete#get_snippets()), 's:compare_words')
endfunction"}}}
function! s:source.gather_candidates(args, context) "{{{
@ -88,7 +90,8 @@ let s:action_table.expand = {
function! s:action_table.expand.func(candidate)"{{{
let context = unite#get_context()
call neocomplcache#sources#snippets_complete#expand(
\ neocomplcache#get_cur_text(1), context.col,
\ neocomplcache#get_cur_text(1) . a:candidate.action__complete_word,
\ context.col,
\ a:candidate.action__complete_word)
endfunction"}}}

View File

@ -296,6 +296,7 @@ CHANGELOG *neocomplcache-snippets-complete-changelog*
2012-03-07
- Added snippet source.
- Fixed snippet source behavior.
2012-03-06
- Improved ftplugin.