- Changed filtering behavior.
This commit is contained in:
parent
60e460f886
commit
938e614056
@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: snippets_complete.vim
|
" FILE: snippets_complete.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
||||||
" Last Modified: 02 Mar 2013.
|
" Last Modified: 06 Mar 2013.
|
||||||
" License: MIT license {{{
|
" License: MIT license {{{
|
||||||
" Permission is hereby granted, free of charge, to any person obtaining
|
" Permission is hereby granted, free of charge, to any person obtaining
|
||||||
" a copy of this software and associated documentation files (the
|
" a copy of this software and associated documentation files (the
|
||||||
@ -82,9 +82,9 @@ function! s:keyword_filter(snippets, cur_keyword_str) "{{{
|
|||||||
endfor
|
endfor
|
||||||
|
|
||||||
if len(a:cur_keyword_str) > 1 && a:cur_keyword_str =~ '^\h\w*$'
|
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),
|
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)))
|
\ string(a:cur_keyword_str)))
|
||||||
for snippet in partial_list
|
for snippet in partial_list
|
||||||
" Set refresh flag.
|
" Set refresh flag.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: neosnippet.vim
|
" FILE: neosnippet.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
||||||
" Last Modified: 05 Mar 2013.
|
" Last Modified: 06 Mar 2013.
|
||||||
" License: MIT license {{{
|
" License: MIT license {{{
|
||||||
" Permission is hereby granted, free of charge, to any person obtaining
|
" Permission is hereby granted, free of charge, to any person obtaining
|
||||||
" a copy of this software and associated documentation files (the
|
" 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', [])
|
for alias in get(a:snippet_dict, 'alias', [])
|
||||||
let alias_snippet = copy(snippet)
|
let alias_snippet = copy(snippet)
|
||||||
let alias_snippet.word = alias
|
let alias_snippet.word = alias
|
||||||
let alias_snippet.filter_str = alias
|
|
||||||
|
|
||||||
let a:snippets[alias] = alias_snippet
|
let a:snippets[alias] = alias_snippet
|
||||||
let a:dup_check[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 = {
|
let snippet = {
|
||||||
\ 'word' : a:dict.name, 'snip' : a:dict.word,
|
\ 'word' : a:dict.name, 'snip' : a:dict.word,
|
||||||
\ 'filter_str' : a:dict.name . ' ' . a:dict.abbr,
|
|
||||||
\ 'description' : a:dict.word,
|
\ 'description' : a:dict.word,
|
||||||
\ 'menu_template' : menu_prefix . abbr,
|
\ 'menu_template' : menu_prefix . abbr,
|
||||||
\ 'menu_abbr' : abbr,
|
\ 'menu_abbr' : abbr,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# lua's indent plugin doesn't work well partly with markers. Use hard-tab for some of this snippet.
|
# lua's indent plugin doesn't work well partly with markers. Use hard-tab for some of this snippet.
|
||||||
snippet func
|
snippet func
|
||||||
alias function name(args)...end
|
abbr function name(args)...end
|
||||||
options word
|
options word
|
||||||
function ${1:#:function_name}(${2:#:argument})
|
function ${1:#:function_name}(${2:#:argument})
|
||||||
${0:TARGET}
|
${0:TARGET}
|
||||||
|
@ -741,6 +741,9 @@ Because neosnippet uses select-mode to jump over placeholder.
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
CHANGELOG *neosnippet-changelog*
|
CHANGELOG *neosnippet-changelog*
|
||||||
|
|
||||||
|
2013-03-06
|
||||||
|
- Changed filtering behavior.
|
||||||
|
|
||||||
2013-03-05
|
2013-03-05
|
||||||
- Fixed error in snippet source.
|
- Fixed error in snippet source.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user