ziglang / zig.vim

Vim configuration for Zig
MIT License
448 stars 56 forks source link

Do fmt and ast-check steps separately #72

Closed euclidianAce closed 2 years ago

euclidianAce commented 2 years ago

This splits up the ast check and formatting actions on save so that formatting can still run when there are simple errors like unused variables, but the errors still show up after formatting. Additionally this allows disabling one or the other (or both) through g:zig_fmt_autosave, g:zig_ast_check_autosave. To have the old behavior of running zig fmt --ast-check you can use g:zig_fmt_ast_check_autosave = 1

andrewrk commented 2 years ago

Thanks!

andrewrk commented 2 years ago

I'm going to revert this because it's causing this problem to happen:

image

Can you spot the error? The diagnostic doesn't help because it's wrong

andrewrk commented 2 years ago

Reverted in 10ff26328cf8e5ed2938b96da6f8c20737eb444a. Now it's fixed:

image