TheBB / spaceline

Powerline theme from Spacemacs
GNU General Public License v3.0
536 stars 59 forks source link

Segment background is messed up with :face on projectile-root #80

Open angrybacon opened 8 years ago

angrybacon commented 8 years ago

With (projectile-root):

screen shot 2016-06-10 at 10 24 44

With (projectile-root :face font-lock-function-name-face):

screen shot 2016-06-10 at 10 26 01

I've also tried with a newly defined face.

Here is how I setup spaceline, using use-package:

(use-package spaceline :demand t)
(use-package spaceline-config

  :ensure nil
  :after spaceline

  :config

  ;; Configure the mode-line
  (setq-default
   mode-line-format '("%e" (:eval (spaceline-ml-main)))
   powerline-default-separator 'wave
   powerline-height 20
   spaceline-highlight-face-func 'spaceline-highlight-face-modified
   spaceline-separator-dir-left '(left . left)
   spaceline-separator-dir-right '(right . right))

  ;; Build the segments
  (spaceline-define-segment me/version-control
    "Version control branch."
    (when vc-mode
      (substring
       vc-mode (+ 2 (length (symbol-name (vc-backend buffer-file-name)))))))

  ;; Build the mode-line
  (spaceline-install
   `((major-mode :face highlight-face)
     ((remote-host buffer-id line) :separator ":"))
   `((selection-info)
     ((flycheck-error flycheck-warning flycheck-info) :when active)
     (projectile-root :face font-lock-function-name-face)
     (("⎇" me/version-control) :when vc-mode)
     (global :face highlight-face)))

  ;; Customize the mode-line
  (set-face-attribute 'mode-line nil
                      :box `(:line-width 1 :color ,zenburn/bg-1)
                      :foreground zenburn/bg+3
                      :height me/font-size-mode-line)
  (set-face-attribute 'mode-line-inactive nil
                      :box `(:line-width 1 :color ,zenburn/bg-1)
                      :foreground zenburn/bg+3
                      :height me/font-size-mode-line))
TheBB commented 8 years ago

Yeah I can reproduce this but I have no idea what is wrong. Seems the right faces are being used so I don't know why it looks like that. Will have to spend some time on this.

jwintz commented 7 years ago

Same here:

screen shot 2017-01-05 at 13 59 56

My custom segment to display current conda environment is as follows. The foreground colour is right, but the background one is not.

  (spaceline-define-segment prolusion-conda-environment
    (when (string= major-mode "python-mode")
      (if (not (equal (length conda-env-current-name) 0))
          (propertize (concat "conda: " conda-env-current-name) 'face '(:foreground "IndianRed"))
        (propertize "no conda environment" 'face '(:foreground "IndianRed")))))