diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index 804cb92..24fa1b4 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -418,11 +418,8 @@ function! s:get_prev_word(cur_keyword_str)"{{{ endfunction"}}} function! s:get_cursor_snippet(snippets, cur_text)"{{{ let cur_word = matchstr(a:cur_text, '\S\+$') - while cur_word != '' && !has_key(a:snippets, cur_word) - let cur_word = cur_word[1:] - endwhile - return cur_word + return has_key(a:snippets, cur_word) ? cur_word : '' endfunction"}}} function! s:snippets_expand(cur_text, col)"{{{ let cur_word = s:get_cursor_snippet( @@ -463,14 +460,7 @@ function! s:snippets_jump(cur_text, col)"{{{ endfunction"}}} function! s:snippets_expand_or_jump(cur_text, col)"{{{ let cur_word = s:get_cursor_snippet( - \ neosnippet#get_snippets(), - \ a:cur_text) - if cur_word == '' - " Check by force_expand. - let cur_word = s:get_cursor_snippet( - \ neosnippet#get_snippets(), - \ a:cur_text) - endif + \ neosnippet#get_snippets(), a:cur_text) if cur_word != '' " Found snippet trigger. diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index cdbc872..c468c0e 100644 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -396,6 +396,7 @@ CHANGELOG *neosnippet-changelog* - Refactored snippets filter. - Changed :NeoSnippetEdit behavior. - Added scala snip. +- Fixed s:get_cursor_snippet(). 2012-10-01 - Deleted neosnippet#force_expandable().