diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 21:52:58 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 21:52:58 +0000 |
commit | 931bffbda3668ddc609fc1da8f9eb576b170aa52 (patch) | |
tree | d8c1843a95da5ea0bb4acc09f7e37843d9995c86 /runtime/ftplugin/zig.vim | |
parent | 142d9041391780ac15b89886a54015fdc5c73995 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-userreg.tar.gz rneovim-userreg.tar.bz2 rneovim-userreg.zip |
Merge remote-tracking branch 'upstream/master' into userreguserreg
Diffstat (limited to 'runtime/ftplugin/zig.vim')
-rw-r--r-- | runtime/ftplugin/zig.vim | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/runtime/ftplugin/zig.vim b/runtime/ftplugin/zig.vim index e740a52849..28b8cd5a67 100644 --- a/runtime/ftplugin/zig.vim +++ b/runtime/ftplugin/zig.vim @@ -17,7 +17,7 @@ compiler zig_build " Match Zig builtin fns setlocal iskeyword+=@-@ -" Recomended code style, no tabs and 4-space indentation +" Recommended code style, no tabs and 4-space indentation setlocal expandtab setlocal tabstop=8 setlocal softtabstop=4 @@ -28,7 +28,7 @@ setlocal formatoptions-=t formatoptions+=croql setlocal suffixesadd=.zig,.zir if has('comments') - setlocal comments=:///,://!,://,:\\\\ + setlocal comments=:///,://!,:// setlocal commentstring=//\ %s endif @@ -39,7 +39,9 @@ endif let &l:define='\v(<fn>|<const>|<var>|^\s*\#\s*define)' -if !exists('g:zig_std_dir') && exists('*json_decode') && executable('zig') +" Safety check: don't execute zig from current directory +if !exists('g:zig_std_dir') && exists('*json_decode') && + \ executable('zig') && dist#vim#IsSafeExecutable('zig', 'zig') silent let s:env = system('zig env') if v:shell_error == 0 let g:zig_std_dir = json_decode(s:env)['std_dir'] @@ -48,7 +50,7 @@ if !exists('g:zig_std_dir') && exists('*json_decode') && executable('zig') endif if exists('g:zig_std_dir') - let &l:path = &l:path . ',' . g:zig_std_dir + let &l:path = g:zig_std_dir . ',' . &l:path endif let b:undo_ftplugin = |