aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin/zig.vim
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
commit1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch)
treecd08258054db80bb9a11b1061bb091c70b76926a /runtime/ftplugin/zig.vim
parenteaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-aucmd_textputpost.tar.gz
rneovim-aucmd_textputpost.tar.bz2
rneovim-aucmd_textputpost.zip
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'runtime/ftplugin/zig.vim')
-rw-r--r--runtime/ftplugin/zig.vim10
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 =