Skip to content

Commit

Permalink
feat: Add custom faces
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed May 9, 2024
1 parent f0289c8 commit f809e62
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions sideline-flycheck.el
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@
(defvar-local sideline-flycheck--errors (ht-create)
"Store error messages as key.")

(defface sideline-flycheck-error
`((t :inherit error))
"Indicate error operation."
:group 'sideline-flycheck)

(defface sideline-flycheck-warning
`((t :inherit warning))
"Indicate warning operation."
:group 'sideline-flycheck)

(defface sideline-flycheck-success
`((t :inherit success))
"Indicate successful operation."
:group 'sideline-flycheck)

;;;###autoload
(defun sideline-flycheck (command)
"Backend for sideline.
Expand Down Expand Up @@ -106,9 +121,9 @@ Argument COMMAND is required in sideline backend."
(dolist (err errors)
(let* ((level (sideline-2str (flycheck-error-level err)))
(face (cond
((string-match-p "warning" level) 'warning)
((string-match-p "error" level) 'error)
(t 'success)))
((string-match-p "warning" level) 'sideline-flycheck-warning)
((string-match-p "error" level) 'sideline-flycheck-error)
(t 'sideline-flycheck-success)))
(msg (flycheck-error-message err))
(lines (split-string msg "\n"))
(lines (butlast lines (- (length lines) sideline-flycheck-max-lines)))
Expand Down

0 comments on commit f809e62

Please sign in to comment.