Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flycheck-color-mode-line does not colorize properly the powerline #3

Open
arranger1044 opened this issue Jan 2, 2014 · 6 comments
Open
Labels

Comments

@arranger1044
Copy link

I am not able to have flycheck-color-mode-line coexist properly with powerline since it does not colorize the endings of the separators as show in this picture:

schermata 01-2456660 alle 09 18 22

Here is my configuration:

;; powerline
(require 'powerline)
(powerline-center-theme)
;; flycheck-color-mode-line
(require 'flycheck-color-mode-line)
(eval-after-load "flycheck"
    '(add-hook 'flycheck-mode-hook 'flycheck-color-mode-line-mode))

but I suspect I'm missing something

@ghost ghost assigned syl20bnr Jan 13, 2014
@syl20bnr
Copy link
Collaborator

@arranger1044 I noticed this using some other themes like zenburn, I will check if I can find a way to make the powerline works with all themes.

@cdlm
Copy link

cdlm commented Dec 2, 2014

Not sure it's exactly related, mode-line is hardcoded as the face that's remapped. That might be a sensible default, but wouldn't making that configurable help? The use-case I'm thinking of is coloring just a single component of my modeline, that should stay colored in inactive modelines as well.

@vmalloc
Copy link

vmalloc commented Dec 16, 2015

Anybody have any idea how to fix this? I'm also unable to get this mode to work properly with powerline...

mattfidler added a commit to mattfidler/powerline that referenced this issue Mar 6, 2016
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.
@mattfidler
Copy link

You can add the following after you load powerline

(defun pl/background-color (face)
  (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)))

I have added a pull request to try to fix this properly.

@mattfidler
Copy link

This doesn't completely fix the issue. You have to call the powerline separators with the new fonts. Otherwise, it memoizes the wrong colors.

I fixed it in ergoemacs-status by the following function

(defun ergoemacs-status--sep (dir &rest args)
  "Separator with DIR.
The additional ARGS are the fonts applied.  This uses `powerline' functions."
  (let ((separator (and (fboundp #'powerline-current-separator)
            (intern (format "powerline-%s-%s"
                    (powerline-current-separator)
                    (or (and (eq dir 'left)
                         (car powerline-default-separator-dir))
                        (cdr powerline-default-separator-dir))))))
    (args (mapcar
           (lambda(f)
         (let ((fa (assoc f face-remapping-alist)))
           (if fa
               (car (cdr fa))
             f)))
           args)))
    (when (fboundp separator)
      (let ((img (apply separator args)))
    (when (and (listp img) (eq 'image (car img)))
      (propertize " " 'display img
              'face (plist-get (cdr img) :face)))))))

If you use this function in your powerline theme, it will work since powerline will memoize the remapped fonts.

@kootenpv
Copy link

@mattfidler Could you please elaborate? How can we use this as a fix? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants