From e367cd6330c61e5fa46cd339a6f2f51db4406784 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Fri, 2 Nov 2012 14:39:23 +0900 Subject: [PATCH] - Improved partial match behavior. --- .../neocomplcache/sources/snippets_complete.vim | 14 +++++++++++--- doc/neosnippet.txt | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/autoload/neocomplcache/sources/snippets_complete.vim b/autoload/neocomplcache/sources/snippets_complete.vim index c53689e..8a6a33f 100644 --- a/autoload/neocomplcache/sources/snippets_complete.vim +++ b/autoload/neocomplcache/sources/snippets_complete.vim @@ -81,9 +81,17 @@ endfunction"}}} function! s:keyword_filter(snippets, cur_keyword_str)"{{{ " Uniq by real_name. let dict = {} - let list = filter(values(a:snippets), - \ printf('v:val.abbr =~ %s', - \ string(neocomplcache#keyword_escape(a:cur_keyword_str)))) + + if len(a:cur_keyword_str) > 1 + " Use partial match by abbr. + let list = filter(values(a:snippets), + \ printf('v:val.abbr =~ %s', + \ string(neocomplcache#keyword_escape(a:cur_keyword_str)))) + else + " Use default filter. + let list = neocomplcache#keyword_filter( + \ values(a:snippets), a:cur_keyword_str) + endif " Add cur_keyword_str snippet. if has_key(a:snippets, a:cur_keyword_str) diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index 2c4ea65..468fc49 100644 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -659,6 +659,7 @@ CHANGELOG *neosnippet-changelog* - Added g:neosnippet#enable_snipmate_compatibility option. - Used partial match for neocomplcache completion. - Fixed for neocomplcache. +- Improved partial match behavior. 2012-11-01 - Fixed snippet mirror behavior.