- Changed filtering behavior.

This commit is contained in:
Shougo Matsushita 2013-03-06 00:23:10 +09:00
parent 60e460f886
commit 938e614056
4 changed files with 8 additions and 7 deletions

View File

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

View File

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

View File

@ -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}

View File

@ -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.