From fcf3af4b46436419e3d959a9cc02ae3e9a75f5fa Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sat, 1 Sep 2012 10:50:22 +0900 Subject: [PATCH 1/2] - Changed (neocomplcache_snippets_expand) behavior. --- autoload/neocomplcache/sources/snippets_complete.vim | 9 ++++++++- doc/neocomplcache-snippets-complete.txt | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/autoload/neocomplcache/sources/snippets_complete.vim b/autoload/neocomplcache/sources/snippets_complete.vim index b15a4db..1d83c58 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 Aug 2012. +" Last Modified: 01 Sep 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 @@ -497,6 +497,13 @@ function! s:snippets_expand_or_jump(cur_text, col)"{{{ let cur_word = s:get_cursor_keyword_snippet( \ neocomplcache#sources#snippets_complete#get_snippets(), \ a:cur_text) + if cur_word == '' + " Check by force_expand. + let cur_word = s:get_cursor_snippet( + \ neocomplcache#sources#snippets_complete#get_snippets(), + \ a:cur_text) + endif + if cur_word != '' " Found snippet trigger. call neocomplcache#sources#snippets_complete#expand( diff --git a/doc/neocomplcache-snippets-complete.txt b/doc/neocomplcache-snippets-complete.txt index 681941c..08fd879 100644 --- a/doc/neocomplcache-snippets-complete.txt +++ b/doc/neocomplcache-snippets-complete.txt @@ -309,6 +309,9 @@ snippet *neocomplcache-snippets-complete-unite-action-snippet* ============================================================================== CHANGELOG *neocomplcache-snippets-complete-changelog* +2012-08-30 +- Changed (neocomplcache_snippets_expand) behavior. + 2012-08-27 - Fixed neocomplcache#sources#snippets_complete#force_expandable(). From d2f088dee53599520aa43b6d3dbd9caac5e806a4 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sat, 1 Sep 2012 10:51:59 +0900 Subject: [PATCH 2/2] - Improved documentation. --- doc/neocomplcache-snippets-complete.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/neocomplcache-snippets-complete.txt b/doc/neocomplcache-snippets-complete.txt index 08fd879..f6dc5d3 100644 --- a/doc/neocomplcache-snippets-complete.txt +++ b/doc/neocomplcache-snippets-complete.txt @@ -116,10 +116,8 @@ KEY MAPPINGS *neocomplcache-snippets-complete-key-mappings* Expand a cursor snippet of plural lines. When there is not a snippet, jump to next placeholder. - Note: cursor snippet must be match keyword patterns. - For example if snippet name is ".", snippets_complete don't expand it. - If you expand snippet ".", Please use - |(neocomplcache_snippets_force_expand)|. + Note: It searches cursor snippet from keyword patterns in the + first. (neocomplcache_snippets_jump) *(neocomplcache_snippets_jump)* Jump to next placeholder. If there is no placeholder, expand a