diff --git a/autoload/neocomplcache/sources/snippets_complete.vim b/autoload/neocomplcache/sources/snippets_complete.vim index 0799695..1641ee5 100644 --- a/autoload/neocomplcache/sources/snippets_complete.vim +++ b/autoload/neocomplcache/sources/snippets_complete.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: snippets_complete.vim " AUTHOR: Shougo Matsushita -" Last Modified: 28 Oct 2012. +" Last Modified: 02 Nov 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 @@ -79,8 +79,9 @@ endfunction"}}} function! s:keyword_filter(snippets, cur_keyword_str)"{{{ " Uniq by real_name. let dict = {} - let list = neocomplcache#keyword_filter( - \ values(a:snippets), a:cur_keyword_str) + let list = filter(values(a:snippets), + \ printf('v:val.abbr =~ %s', + \ string(neocomplcache#keyword_escape(a:cur_keyword_str)))) " Add cur_keyword_str snippet. if has_key(a:snippets, a:cur_keyword_str) diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index 95db9cd..d50f916 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -213,6 +213,7 @@ function! s:initialize_snippet(dict, path, line, pattern, name)"{{{ let dict = { \ 'word' : a:dict.name, 'snip' : a:dict.word, + \ 'abbr' : a:dict.abbr, \ 'description' : a:dict.word, \ 'menu' : menu_pattern.abbr, \ 'dup' : 1, 'options' : a:dict.options, diff --git a/autoload/unite/sources/snippet.vim b/autoload/unite/sources/snippet.vim index eaa99e0..a202e3f 100644 --- a/autoload/unite/sources/snippet.vim +++ b/autoload/unite/sources/snippet.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: snippet.vim " AUTHOR: Shougo Matsushita -" Last Modified: 31 Oct 2012. +" Last Modified: 02 Nov 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 @@ -64,8 +64,7 @@ function! s:source.gather_candidates(args, context) "{{{ let list = [] for keyword in a:context.source__snippets let dict = { - \ 'word' : keyword.word, - \ 'abbr' : printf('%-50s %s', keyword.word, keyword.menu), + \ 'word' : printf('%-50s %s', keyword.word, keyword.menu), \ 'kind': 'snippet', \ 'action__complete_word' : keyword.word, \ 'action__complete_pos' : keyword_pos, diff --git a/autoload/unite/sources/snippet_target.vim b/autoload/unite/sources/snippet_target.vim index bbe5581..07751c2 100644 --- a/autoload/unite/sources/snippet_target.vim +++ b/autoload/unite/sources/snippet_target.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: snippet_target.vim " AUTHOR: Shougo Matsushita -" Last Modified: 31 Oct 2012. +" Last Modified: 02 Nov 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 @@ -57,8 +57,8 @@ function! s:source.gather_candidates(args, context) "{{{ let list = [] for keyword in a:context.source__snippets let dict = { - \ 'word' : keyword.word, - \ 'abbr' : printf('%-50s %s', keyword.word, keyword.menu), + \ 'word' : printf('%-50s %s', keyword.word, keyword.menu), + \ 'source__trigger' : keyword.word, \ 'source__menu' : keyword.menu, \ 'source__snip' : keyword.snip, \ 'source__context' : a:context, @@ -98,7 +98,7 @@ function! s:source.action_table.select.func(candidate)"{{{ call cursor(0, getpos("'<")[2]) call neosnippet#expand(neosnippet#util#get_cur_text(), - \ col('.'), a:candidate.word) + \ col('.'), a:candidate.source__trigger) endfunction"}}} "}}} diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index 47ae2c9..a737c96 100644 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -337,6 +337,9 @@ EXAMPLES *neosnippet-examples* " Enable snipMate compatibility feature. " let g:neosnippet#enable_snipmate_compatibility = 1 + + " For neocomplcache partial match. + " let g:neocomplcache_enable_refresh_always = 1 < ============================================================================== SNIPPET SYNTAX *neosnippet-snippet-syntax* @@ -657,6 +660,7 @@ CHANGELOG *neosnippet-changelog* 2012-11-02 - Added g:neosnippet#enable_snipmate_compatibility option. +- Used partial match for neocomplcache completion. 2012-11-01 - Fixed snippet mirror behavior.