- Improved filetype complete.

This commit is contained in:
Shougo Matsushita
2012-09-30 17:45:41 +09:00
parent d5e1a678d4
commit 0739b9b12e
4 changed files with 48 additions and 24 deletions

View File

@@ -1,7 +1,7 @@
"=============================================================================
" FILE: snippets_complete.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 28 Sep 2012.
" Last Modified: 30 Sep 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,11 +53,13 @@ endfunction"}}}
function! s:source.get_keyword_list(cur_keyword_str)"{{{
let all_snippets = neosnippet#get_snippets()
let filetype = neocomplcache#get_context_filetype()
if !has_key(all_snippets, filetype)
" Caching snippets.
call neosnippet#caching_snippets(filetype)
endif
for filetype in neocomplcache#get_source_filetypes(
\ neosnippet#get_filetype())
if !has_key(s:snippets, filetype)
" Caching snippets.
call neosnippet#caching_snippets(filetype)
endif
endfor
return s:keyword_filter(neocomplcache#dup_filter(
\ values(all_snippets)), a:cur_keyword_str)