From 7219f062fa8d49d34858d1f42023fb1fe759b4a1 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Mon, 15 Oct 2012 08:39:34 +0900 Subject: [PATCH] - Improved error check. --- autoload/unite/sources/snippet.vim | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/autoload/unite/sources/snippet.vim b/autoload/unite/sources/snippet.vim index 28d8009..2ef7971 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: 30 Sep 2012. +" Last Modified: 15 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 @@ -118,6 +118,20 @@ unlet! s:action_table "}}} function! unite#sources#snippet#start_complete() "{{{ + if !exists(':Unite') + call neosnippet#util#print_error( + \ 'unite.vim is not installed.') + call neosnippet#util#print_error( + \ 'Please install unite.vim Ver.1.5 or above.') + return '' + elseif unite#version() < 300 + call neosnippet#util#print_error( + \ 'Your unite.vim is too old.') + call neosnippet#util#print_error( + \ 'Please install unite.vim Ver.3.0 or above.') + return '' + endif + return unite#start_complete(['snippet'], \ { 'input': neosnippet#util#get_cur_text() }) endfunction "}}}