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
37
37
let g:zig_fmt_autosave = 0
38
38
```
39
39
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
+
40
48
The default compiler which gets used by ` :make ` (` :help :compiler ` for details)
41
49
is ` zig_build ` and it runs ` zig build ` . The other options are:
42
50
* ` :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
69
69
70
70
if err != 0
71
71
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
73
78
endif
74
79
75
80
" 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