Skip to content

Commit

Permalink
Respect face remapping in separators
Browse files Browse the repository at this point in the history
When adding face remapping, the background of the face is no longer correct.

This occurs in the flycheck-color-mode-line package: 

flycheck/flycheck-color-mode-line#3

This should fix the issue.
  • Loading branch information
mattfidler committed Mar 6, 2016
1 parent b0793ac commit 6dd3260
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions powerline-separators.el
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,16 @@ destination color, and 2 is the interpolated color between 0 and 1."
(when footer `(mapconcat 'identity ',footer ""))))))

(defun pl/background-color (face)
(face-attribute face
(if (face-attribute face :inverse-video nil 'default)
:foreground
:background)
nil
'default))
(let ((face face)
(fa (assoc face face-remapping-alist)))
(when fa
(setq face (car (cdr fa))))
(face-attribute face
(if (face-attribute face :inverse-video nil 'default)
:foreground
:background)
nil
'default)))

(defun pl/wrap-defun (name dir width let-vars body)
"Generate a powerline function of NAME in DIR with WIDTH using LET-VARS and BODY."
Expand Down

0 comments on commit 6dd3260

Please sign in to comment.