- Used partial match for neocomplcache completion.

This commit is contained in:
Shougo Matsushita
2012-11-02 11:19:46 +09:00
parent c9a8833b60
commit 9f74be4e7c
5 changed files with 15 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
"=============================================================================
" FILE: snippets_complete.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" 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)