emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/zig-mode 1ef8a13b93: Add optional ansi-coloration for the


From: ELPA Syncer
Subject: [nongnu] elpa/zig-mode 1ef8a13b93: Add optional ansi-coloration for the zig-fmt buffer (#65)
Date: Mon, 27 Dec 2021 06:58:33 -0500 (EST)

branch: elpa/zig-mode
commit 1ef8a13b93b3bdd20f86727b3a71572b02c421ef
Author: Geoffrey J. Teale <tealeg@googlemail.com>
Commit: GitHub <noreply@github.com>

    Add optional ansi-coloration for the zig-fmt buffer (#65)
---
 zig-mode.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/zig-mode.el b/zig-mode.el
index 5b47de3cd4..4064605557 100644
--- a/zig-mode.el
+++ b/zig-mode.el
@@ -126,6 +126,9 @@ If given a SOURCE, execute the CMD on it."
 (defvar zig-return-to-buffer-after-format nil
   "Enable zig-format-buffer to return to file buffer after fmt is done.")
 
+(defvar zig-ansi-color-for-format-errors nil
+  "Enable ansi-coloration of error output from zig fmt.")
+
 ;;;###autoload
 (defun zig-format-buffer ()
   "Format the current buffer using the zig fmt."
@@ -150,6 +153,8 @@ If given a SOURCE, execute the CMD on it."
              (when zig-format-show-buffer
                (progn
                  (pop-to-buffer fmt-buffer)
+                 (when zig-ansi-color-for-format-errors
+                   (ansi-color-apply-on-region (point-min) (point-max)))
                  (compilation-mode)
                  (when zig-return-to-buffer-after-format
                    (pop-to-buffer file-buffer))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]