From ce8e095c9c632e2644266d3e1e3f5a34311be335 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Thu, 4 Oct 2012 14:28:37 +0900 Subject: [PATCH] - Fixed s:get_cursor_snippet(). --- autoload/neosnippet.vim | 14 ++------------ doc/neosnippet.txt | 1 + 2 files changed, 3 insertions(+), 12 deletions(-) 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().