- Fixed #190 regexp feature.

This commit is contained in:
Shougo Matsushita 2013-11-18 12:02:49 +09:00
parent b59609c74e
commit afa9ecc176

View File

@ -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: 12 Nov 2013. " Last Modified: 18 Nov 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
@ -1012,16 +1012,17 @@ function! neosnippet#get_snippets() "{{{
call extend(snippets, s:snippets[filetype], 'keep') call extend(snippets, s:snippets[filetype], 'keep')
endfor endfor
let cur_text = neosnippet#util#get_cur_text()
if mode() ==# 'i' if mode() ==# 'i'
" Special filters. " Special filters.
let cur_text = neosnippet#util#get_cur_text()
if !s:is_beginning_of_line(cur_text) if !s:is_beginning_of_line(cur_text)
call filter(snippets, '!v:val.options.head') call filter(snippets, '!v:val.options.head')
endif endif
call filter(snippets, "cur_text =~ get(v:val, 'regexp', '')")
endif endif
call filter(snippets, "cur_text =~# get(v:val, 'regexp', '')")
return snippets return snippets
endfunction"}}} endfunction"}}}
function! neosnippet#get_snippets_directory() "{{{ function! neosnippet#get_snippets_directory() "{{{