From 97b0a2a246225e1f8d65587c548533e5d9bec156 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Thu, 18 Oct 2012 11:57:09 +0900 Subject: [PATCH] - Fixed s:get_sources_list(). --- autoload/neosnippet.vim | 10 ++++------ autoload/unite/sources/snippet.vim | 5 +++-- doc/neosnippet.txt | 1 + 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index 97120bf..efcc9cd 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: neosnippet.vim " AUTHOR: Shougo Matsushita -" 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)"{{{ diff --git a/autoload/unite/sources/snippet.vim b/autoload/unite/sources/snippet.vim index 2ef7971..edd5759 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: 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 "}}} diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index fd7c72f..0f71e53 100644 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -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.