diff --git a/README.md b/README.md index e69de29..01981ee 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,9 @@ +## About + +It is old version of neocomplcache-snippets-complete. +It is no longer maintained. + +You should use neosnippet instead of it. + +https://github.com/Shougo/neosnippet + diff --git a/autoload/neocomplcache/sources/snippets_complete.vim b/autoload/neocomplcache/sources/snippets_complete.vim index 5c003e2..d4ce740 100644 --- a/autoload/neocomplcache/sources/snippets_complete.vim +++ b/autoload/neocomplcache/sources/snippets_complete.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: snippets_complete.vim " AUTHOR: Shougo Matsushita -" Last Modified: 27 Sep 2012. +" Last Modified: 17 Oct 2012. " License: MIT license {{{ " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the @@ -209,7 +209,7 @@ endfunction"}}} function! s:keyword_filter(list, cur_keyword_str)"{{{ let keyword_escape = neocomplcache#keyword_escape(a:cur_keyword_str) - let prev_word = neocomplcache#get_prev_word(a:cur_keyword_str) + let prev_word = s:get_prev_word(a:cur_keyword_str) " Keyword filter. let pattern = printf('v:val.word =~ %s && (!has_key(v:val, "prev_word") || v:val.prev_word == %s)', \string('^' . keyword_escape), string(prev_word)) @@ -237,6 +237,27 @@ function! s:keyword_filter(list, cur_keyword_str)"{{{ return list endfunction"}}} +function! s:get_prev_word(cur_keyword_str)"{{{ + let keyword_pattern = neocomplcache#get_keyword_pattern() + let line_part = neocomplcache#get_cur_text()[: -1-len(a:cur_keyword_str)] + let prev_word_end = matchend(line_part, keyword_pattern) + if prev_word_end > 0 + let word_end = matchend(line_part, keyword_pattern, prev_word_end) + if word_end >= 0 + while word_end >= 0 + let prev_word_end = word_end + let word_end = matchend(line_part, keyword_pattern, prev_word_end) + endwhile + endif + + let prev_word = matchstr(line_part[: prev_word_end-1], keyword_pattern . '$') + else + let prev_word = '^' + endif + + return prev_word +endfunction"}}} + function! neocomplcache#sources#snippets_complete#expandable()"{{{ let ret = 0 diff --git a/doc/neocomplcache-snippets-complete.txt b/doc/neocomplcache-snippets-complete.txt index b3a84d7..7509387 100644 --- a/doc/neocomplcache-snippets-complete.txt +++ b/doc/neocomplcache-snippets-complete.txt @@ -39,9 +39,12 @@ Changelog |neocomplcache-snippets-complete-changelog| ============================================================================== INTRODUCTION *neocomplcache-snippets-complete-introduction* -This source analyzes snippet files for completion, offers functionality -similar to snipMate.vim or snippetsEmu.vim. Since you can choose snippet with -neocomplcache interface, you might have less trouble learning it. +It is old version of neocomplcache-snippets-complete. +It is no longer maintained. + +You should use neosnippet instead of it. + +https://github.com/Shougo/neosnippet ============================================================================== INSTALL *neocomplcache-snippets-complete-install*