- Fixed s:get_sources_list().

This commit is contained in:
Shougo Matsushita 2012-10-18 11:57:09 +09:00
parent a0600fa2fe
commit 97b0a2a246
3 changed files with 8 additions and 8 deletions

View File

@ -1,7 +1,7 @@
"=============================================================================
" FILE: neosnippet.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 17 Oct 2012.
" Last Modified: 18 Oct 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
@ -815,11 +815,8 @@ function! neosnippet#get_snippets()"{{{
call neosnippet#make_cache('_')
endif
" Get buffer filetype.
let filetype = neosnippet#get_filetype()
let snippets = {}
for source in s:get_sources_list(s:snippets, filetype)
for source in s:get_sources_list(s:snippets, neosnippet#get_filetype())
call extend(snippets, source, 'keep')
endfor
call extend(snippets, copy(s:snippets['_']), 'keep')
@ -846,7 +843,8 @@ function! neosnippet#get_filetype()"{{{
endfunction"}}}
function! s:get_sources_list(snippets, filetype)"{{{
return exists('*neocomplcache#get_sources_list') ?
\ neocomplcache#get_sources_list(a:snippets, a:filetype) : a:filetype
\ neocomplcache#get_sources_list(a:snippets, a:filetype) :
\ get(a:snippets, a:filetype, [])
endfunction"}}}
function! neosnippet#edit_complete(arglead, cmdline, cursorpos)"{{{

View File

@ -1,7 +1,7 @@
"=============================================================================
" FILE: snippet.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 15 Oct 2012.
" Last Modified: 18 Oct 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
@ -73,6 +73,7 @@ function! s:source.gather_candidates(args, context) "{{{
\ 'action__pattern' : keyword.action__pattern,
\ 'source__menu' : keyword.menu,
\ 'source__snip' : keyword.snip,
\ 'source__snip_ref' : keyword,
\ }
call add(list, dict)
@ -113,7 +114,7 @@ function! s:action_table.preview.func(candidates)"{{{
endfor
endfunction"}}}
let s:source.action_table['*'] = s:action_table
let s:source.action_table = s:action_table
unlet! s:action_table
"}}}

View File

@ -418,6 +418,7 @@ CHANGELOG *neosnippet-changelog*
2012-10-17
- Fixed alias problem.
- Improved escape placeholder.
- Fixed s:get_sources_list().
2012-10-15
- Improved lua snip.