From 81a638762b5c664039ba80558b1b90b207557be9 Mon Sep 17 00:00:00 2001 From: gryf Date: Tue, 24 May 2016 14:56:40 +0200 Subject: [PATCH] Moved variable with script path out of function Otherwise it will point to the current path, instead of script path. Changing it to script variables will change that behaviour to desirable one. --- plugin/pythonhelper.vim | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugin/pythonhelper.vim b/plugin/pythonhelper.vim index 0106881..628cd4d 100644 --- a/plugin/pythonhelper.vim +++ b/plugin/pythonhelper.vim @@ -1,8 +1,8 @@ " File: pythonhelper.vim " Author: Michal Vitecek " Author: Roman Dobosz -" Version: 0.84 -" Last Modified: 2016-05-21 +" Version: 0.85 +" Last Modified: 2016-05-24 " " Overview " -------- @@ -33,15 +33,16 @@ " VIM functions {{{ let g:pythonhelper_python = 'python' +let s:plugin_path = expand(':p:h', 1) + function! s:PHLoader() - let l:plugin_path = escape(expand(':p:h'), '\') if !exists('g:pythonhelper_py_loaded') if has('python') - exe 'pyfile ' . escape(l:plugin_path, ' ') . '/pythonhelper.py' + exe 'pyfile ' . s:plugin_path . '/pythonhelper.py' elseif has('python3') let g:pythonhelper_python = 'python3' - exe 'py3file ' . escape(l:plugin_path, ' ') . '/pythonhelper.py' + exe 'py3file ' . s:plugin_path . '/pythonhelper.py' else echohl WarningMsg|echomsg \ "PythonHelper unavailable: "