Skip to content

Commit

Permalink
visual: apply ansi color only on compilation major mode
Browse files Browse the repository at this point in the history
Some modes have compilation-mode has parent mode but the ansi coloring
scheme is breaking their highlighting.
i.e. Wilfred/ag.el#124

Fix this by applying ansi-colors only when the major mode is
compilation-mode.

Signed-off-by: Loys Ollivier <[email protected]>
  • Loading branch information
loysollivier authored and Loys Ollivier committed Jul 16, 2020
1 parent 1e677bb commit e0cf9ae
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions layers/+spacemacs/spacemacs-visual/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
;; ansi-colors

(defun spacemacs-visual//compilation-buffer-apply-ansi-colors ()
(let ((inhibit-read-only t))
(goto-char compilation-filter-start)
(ansi-color-apply-on-region (line-beginning-position) (point-max))))
(when (eq major-mode 'compilation-mode)
(let ((inhibit-read-only t))
(goto-char compilation-filter-start)
(ansi-color-apply-on-region (line-beginning-position) (point-max)))))


;; popwin
Expand Down

0 comments on commit e0cf9ae

Please sign in to comment.