aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin/zig.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ftplugin/zig.vim')
-rw-r--r--runtime/ftplugin/zig.vim8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/ftplugin/zig.vim b/runtime/ftplugin/zig.vim
index 45ea582615..2a081980cc 100644
--- a/runtime/ftplugin/zig.vim
+++ b/runtime/ftplugin/zig.vim
@@ -40,17 +40,17 @@ endif
let &l:define='\v(<fn>|<const>|<var>|^\s*\#\s*define)'
" Safety check: don't execute zip from current directory
-let s:tmp_cwd = getcwd()
if !exists('g:zig_std_dir') && exists('*json_decode') &&
- \ executable('zig') && (fnamemodify(exepath("zig"), ":p:h") != s:tmp_cwd
- \ || (index(split($PATH,has("win32")? ';' : ':'), s:tmp_cwd) != -1 && s:tmp_cwd != '.'))
+ \ executable('zig') && get(g:, 'zig_exec', get(g:, 'plugin_exec', 0))
+ \ && (fnamemodify(exepath("zig"), ":p:h") != s:tmp_cwd
+ \ || (index(split($PATH,has("win32")? ';' : ':'), s:tmp_cwd) != -1 && s:tmp_cwd != '.'))
silent let s:env = system('zig env')
if v:shell_error == 0
let g:zig_std_dir = json_decode(s:env)['std_dir']
endif
unlet! s:env
endif
-unlet s:tmp_cwd
+unlet! s:tmp_cwd
if exists('g:zig_std_dir')
let &l:path = &l:path . ',' . g:zig_std_dir