File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ This plugin enables automatic code formatting on save by default using
3737let g:zig_fmt_autosave = 0
3838```
3939
40+ If ` zig fmt ` encounters a code formatting error, this plugin populates
41+ the location list with relevant errors. To disable automatically switching
42+ to the location list, use this configuration in vimrc:
43+
44+ ```
45+ let g:zig_fmt_autoswitch = 0
46+ ```
47+
4048The default compiler which gets used by ` :make ` (` :help :compiler ` for details)
4149is ` zig_build ` and it runs ` zig build ` . The other options are:
4250 * ` :compiler zig_test ` which runs ` zig test ` on the current file.
Original file line number Diff line number Diff line change @@ -69,7 +69,12 @@ function! zig#fmt#Format() abort
6969
7070 if err != 0
7171 echohl Error | echomsg " zig fmt returned error" | echohl None
72- return
72+ if get (g: , ' zig_fmt_autoswitch' , 1 )
73+ return
74+ else
75+ wincmd p
76+ return
77+ endif
7378 endif
7479
7580 " Run the syntax highlighter on the updated content and recompute the folds if
You can’t perform that action at this time.
0 commit comments