From ccff0c703b98f96a2a7c2fa85966d38d64d00c8f Mon Sep 17 00:00:00 2001 From: Tom Oram Date: Thu, 19 Dec 2013 11:30:37 +0000 Subject: [PATCH] Check for existence of g:php_refactor_command --- plugin/phprefactor.vim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugin/phprefactor.vim b/plugin/phprefactor.vim index 7f4e68b..ccd3569 100644 --- a/plugin/phprefactor.vim +++ b/plugin/phprefactor.vim @@ -1,5 +1,6 @@ -let g:php_refactor_command='php ~/bin/refactor.phar' -let g:php_refactor_patch_command='patch -p1' +if !exists("g:php_refactor_patch_command") + let g:php_refactor_patch_command='patch -p1' +endif func! PhpRefactorExtractMethod() " check the file has been saved @@ -70,6 +71,11 @@ func! PhpRefactorOptimizeUse() endfunc func! PhpRefactorRunCommand(refactoring, args) + if !exists("g:php_refactor_command") + echom 'You need to set g:php_refactor_command in your .vimrc' + return + endif + " Enable autoread to stop prompting for reload setlocal autoread