aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin/zig.vim
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
commit21cb7d04c387e4198ca8098a884c78b56ffcf4c2 (patch)
tree84fe5690df1551f0bb2bdfe1a13aacd29ebc1de7 /runtime/ftplugin/zig.vim
parentd9c904f85a23a496df4eb6be42aa43f007b22d50 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-colorcolchar.tar.gz
rneovim-colorcolchar.tar.bz2
rneovim-colorcolchar.zip
Merge remote-tracking branch 'upstream/master' into colorcolcharcolorcolchar
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 =