From 938e6140562e833eed49a0625a1c3e757e667c4d Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Wed, 6 Mar 2013 00:23:10 +0900 Subject: [PATCH] - Changed filtering behavior. --- autoload/neocomplcache/sources/snippets_complete.vim | 6 +++--- autoload/neosnippet.vim | 4 +--- autoload/neosnippet/snippets/lua.snip | 2 +- doc/neosnippet.txt | 3 +++ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/autoload/neocomplcache/sources/snippets_complete.vim b/autoload/neocomplcache/sources/snippets_complete.vim index 97e4afa..265d714 100644 --- a/autoload/neocomplcache/sources/snippets_complete.vim +++ b/autoload/neocomplcache/sources/snippets_complete.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: snippets_complete.vim " AUTHOR: Shougo Matsushita -" Last Modified: 02 Mar 2013. +" Last Modified: 06 Mar 2013. " License: MIT license {{{ " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the @@ -82,9 +82,9 @@ function! s:keyword_filter(snippets, cur_keyword_str) "{{{ endfor if len(a:cur_keyword_str) > 1 && a:cur_keyword_str =~ '^\h\w*$' - " Use partial match by filter_str. + " Use partial match by word. let partial_list = filter(values(a:snippets), - \ printf('stridx(v:val.filter_str, %s) > 0', + \ printf('stridx(v:val.word, %s) > 0', \ string(a:cur_keyword_str))) for snippet in partial_list " Set refresh flag. diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index fa758c6..dabfe13 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: neosnippet.vim " AUTHOR: Shougo Matsushita -" Last Modified: 05 Mar 2013. +" Last Modified: 06 Mar 2013. " License: MIT license {{{ " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the @@ -140,7 +140,6 @@ function! s:set_snippet_dict(snippet_dict, snippets, dup_check, snippets_file) " for alias in get(a:snippet_dict, 'alias', []) let alias_snippet = copy(snippet) let alias_snippet.word = alias - let alias_snippet.filter_str = alias let a:snippets[alias] = alias_snippet let a:dup_check[alias] = alias_snippet @@ -169,7 +168,6 @@ function! s:initialize_snippet(dict, path, line, pattern, name) "{{{ let snippet = { \ 'word' : a:dict.name, 'snip' : a:dict.word, - \ 'filter_str' : a:dict.name . ' ' . a:dict.abbr, \ 'description' : a:dict.word, \ 'menu_template' : menu_prefix . abbr, \ 'menu_abbr' : abbr, diff --git a/autoload/neosnippet/snippets/lua.snip b/autoload/neosnippet/snippets/lua.snip index d10a438..be5408f 100644 --- a/autoload/neosnippet/snippets/lua.snip +++ b/autoload/neosnippet/snippets/lua.snip @@ -1,6 +1,6 @@ # lua's indent plugin doesn't work well partly with markers. Use hard-tab for some of this snippet. snippet func -alias function name(args)...end +abbr function name(args)...end options word function ${1:#:function_name}(${2:#:argument}) ${0:TARGET} diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index b6c9a12..86b98b5 100755 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -741,6 +741,9 @@ Because neosnippet uses select-mode to jump over placeholder. ============================================================================== CHANGELOG *neosnippet-changelog* +2013-03-06 +- Changed filtering behavior. + 2013-03-05 - Fixed error in snippet source.