]]>The zig executable will be looked up in the PATH environment variable so can't you just add the path to it?
The zig executable will be looked up in the PATH environment variable so can't you just add the path to it? It's not really hardcoded because of that.
The current approach results in E488: Trailing characters: sua<setl because setl is not an option.
Can be triggered by opening a zig file and then running :edit %
The path to the zig binary is hardcoded, and in case users don't have it (in case they're building from source or some other reason) it can't be configured.
I see there's work on something related here, but by setting the zig_exe_path variable to something nonexistent the check for cwd isn't necessary.
Fixes #112
By default, vim's system() and systemlist() combine the stderr and
stdout due to the default value of shellredir. This means that drop-in
replacements for zig fmt (e.g. anyzig) will include debug information
along with the successfully-formatted file, even if that debug
information is printed to stderr.
This changes the script to save stdout and stderr separately, which
avoids this class of problems.
This is my and archlinux configuration:
]]>@Techatrix wrote in #122 (comment):
]]>I don't remember when this issue started.
]]>I tested a stock vim configuration without this change and observed no escape codes in the :make build and fmt autosave output. Could you explain in more detail how you managed to observe the issue you are trying to fix here. Reproduction steps (e.g. OS, vim config, commands) would be greatly appreciated.
The more reliable source for the set of builtins can be taken from the Zig codebase directly in std.zig.BuiltinFn. This will include builtins like @disableInstrumentation and @disableIntrinsics that are currently undocumented in the language reference. These two should be added back. The rest of the changes are fine.
Updates syntax highlighting of builtin functions for version 0.16.0, using this as a source of truth.
]]>The Zig compiler enables colors by default, but this is a problem for
Vim, since the error message buf shows the ANSI escape codes.
Disable colors by setting the NO_COLOR environment variable in ftplugin.
Since the environment variable is internal to Vim, it will not disable
colors when using a terminal.
It is perfectly reasonable for a CLI applicaton like zig fmt to write to stderr while expecting the parent process to ignore it on success. It should not be up to anzig or it's users to disable the debug output to become usable with zig.vim. This is just a bug in zig.vim that should be fixed.
I left a comment over on the anyzig issue about this.
]]>Fixes a small typo in the comments of filetype plugin code.
]]>👋 This works well. Thanks for tracking down the root cause, @seandewar!
]]>