From c214bafc5ba89af50e482aa3d1b99c1dc4bff1d4 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Wed, 7 Mar 2012 08:39:08 +0900 Subject: [PATCH] - Fixed snippet source behavior. --- autoload/neocomplcache/sources/snippets_complete.vim | 2 +- autoload/unite/sources/snippet.vim | 11 +++++++---- doc/neocomplcache-snippets-complete.txt | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/autoload/neocomplcache/sources/snippets_complete.vim b/autoload/neocomplcache/sources/snippets_complete.vim index fad5870..282a5a4 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: 03 Mar 2012. +" Last Modified: 07 Mar 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 diff --git a/autoload/unite/sources/snippet.vim b/autoload/unite/sources/snippet.vim index c8392cb..3429285 100644 --- a/autoload/unite/sources/snippet.vim +++ b/autoload/unite/sources/snippet.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: snippet.vim " AUTHOR: Shougo Matsushita -" Last Modified: 02 Feb 2012. +" Last Modified: 07 Mar 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 @@ -53,8 +53,10 @@ let s:source = { \ } function! s:source.hooks.on_init(args, context) "{{{ - let a:context.source__cur_keyword_pos = s:get_keyword_pos(neocomplcache#get_cur_text(1)) - let a:context.source__snippets = sort(values(neocomplcache#sources#snippets_complete#get_snippets()), 's:compare_words') + let a:context.source__cur_keyword_pos = + \ s:get_keyword_pos(neocomplcache#get_cur_text(1)) + let a:context.source__snippets = + \ sort(values(neocomplcache#sources#snippets_complete#get_snippets()), 's:compare_words') endfunction"}}} function! s:source.gather_candidates(args, context) "{{{ @@ -88,7 +90,8 @@ let s:action_table.expand = { function! s:action_table.expand.func(candidate)"{{{ let context = unite#get_context() call neocomplcache#sources#snippets_complete#expand( - \ neocomplcache#get_cur_text(1), context.col, + \ neocomplcache#get_cur_text(1) . a:candidate.action__complete_word, + \ context.col, \ a:candidate.action__complete_word) endfunction"}}} diff --git a/doc/neocomplcache-snippets-complete.txt b/doc/neocomplcache-snippets-complete.txt index 1c9230d..e2c2b6a 100644 --- a/doc/neocomplcache-snippets-complete.txt +++ b/doc/neocomplcache-snippets-complete.txt @@ -296,6 +296,7 @@ CHANGELOG *neocomplcache-snippets-complete-changelog* 2012-03-07 - Added snippet source. +- Fixed snippet source behavior. 2012-03-06 - Improved ftplugin.