This repository was archived by the owner on Nov 26, 2025. It is now read-only.
g:zig_fmt_autoswitch: Configure automatic switching to location list upon zig fmt error#82
Open
atweiden wants to merge 1 commit intoziglang:masterfrom
Open
g:zig_fmt_autoswitch: Configure automatic switching to location list upon zig fmt error#82atweiden wants to merge 1 commit intoziglang:masterfrom
g:zig_fmt_autoswitch: Configure automatic switching to location list upon zig fmt error#82atweiden wants to merge 1 commit intoziglang:masterfrom
Conversation
```vim " don't automatically switch to location list if zig fmt encounters errors let g:zig_fmt_autoswitch = 0 ```
7dbf210 to
208b1bd
Compare
g:zig_fmt_autoswitch: Configure automatic switching to location list upon zig fmt error
g:zig_fmt_autoswitch: Configure automatic switching to location list upon zig fmt errorg:zig_fmt_autoswitch: Configure automatic switching to location list upon zig fmt error
|
I think the logic would be clearer if the call to |
Contributor
Author
|
Can you provide example code? I’m open to making that change, but I don’t see how to restrict calling execute 'silent! lwindow ' . win_height
if !get(g:, 'zig_fmt_autoswitch', 1)
wincmd p
endifI also don’t see what to do with the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Set
g:zig_fmt_autoswitchto 0 in your vimrc to disable automatically switching to the location list if/whenzig fmtencounters code formatting errors.When set to 0,
g:zig_fmt_autoswitchconfigures the Vim cursor to remain where it was prior to runningzig fmt. The location list — which gets populated with code formatting errors as per normal — can then be viewed at a glance, without losing focus.Either don’t set
g:zig_fmt_autoswitchat all, or set it to 1, to keep the current behaviour of this plugin.