ziglang / zig-mode

Zig mode for Emacs
GNU General Public License v3.0
163 stars 54 forks source link

Prefer flycheck and lsp-ui to *zig-fmt* split window #50

Closed toyboot4e closed 2 years ago

toyboot4e commented 3 years ago

Someone on Discord gave me this code that allows flycheck to work with zig-mode:

(flycheck-define-checker zig
    "A zig syntax checker using the zig-fmt interpreter."
    :command ("zig" "fmt" (eval (buffer-file-name)))
    :error-patterns
    ((error line-start (file-name) ":" line ":" column ": error: " (message) line-end))
    :modes zig-mode)
(add-to-list 'flycheck-checkers 'zig)

And both flycheck and lsp-ui worked:

flycheck

However, zig-mode always opens *zig-fmt* split window. This is duplicate, so it's nice if we can suppress the behavior.

Thank you.

q60 commented 2 years ago

i'm stumbling upon this annoying split window issue too. so it's still here. will someone hear us and do something with it? @AndreaOrru ? or someone...

image

joachimschmidt557 commented 2 years ago

@toyboot4e @q60 Does #62 address this issue? If yes, I'll merge that right away.

q60 commented 2 years ago

@toyboot4e @q60 Does #62 address this issue? If yes, I'll merge that right away.

yea, that's a fix for this problem

joachimschmidt557 commented 2 years ago

62 introduces a new defcustom which disables showing the *zig-fmt* buffer when formatting exits with errors.

toyboot4e commented 2 years ago

Yeah it's working. Super comfortable, thanks!