File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ function! zig#fmt#Format() abort
14
14
endif
15
15
16
16
let cmdline = ' zig fmt --stdin --ast-check'
17
+ if expand (' %:e' ) is ? ' zon'
18
+ let cmdline = cmdline . ' --zon'
19
+ endif
20
+
17
21
let current_buf = bufnr (' ' )
18
22
19
23
" The formatted code is output on stdout, the errors go on stderr.
@@ -22,19 +26,8 @@ function! zig#fmt#Format() abort
22
26
else
23
27
silent let out = split (system (cmdline, current_buf))
24
28
endif
25
- if len (out) == 1
26
- if out[0 ] == " error: unrecognized parameter: '--ast-check'"
27
- let cmdline = ' zig fmt --stdin'
28
- if exists (' *systemlist' )
29
- silent let out = systemlist (cmdline, current_buf)
30
- else
31
- silent let out = split (system (cmdline, current_buf))
32
- endif
33
- endif
34
- endif
35
29
let err = v: shell_error
36
30
37
-
38
31
if err == 0
39
32
" remove undo point caused via BufWritePre.
40
33
try | silent undojoin | catch | endtry
You can’t perform that action at this time.
0 commit comments