              (face1 (if active 'powerline-active1 'powerline-inactive1))
              (face2 (if active 'powerline-active2 'powerline-inactive2))
              (face3 (if *init-powerline-shows-rtags-diagnostics*
-                        (my-powerline-theme-buffer-face)
-                      'powerline-active3))
+                        (my-powerline-theme-buffer-face active)
+                      (if active 'powerline-active3 'powerline-inactive3)))
              (separator-left (intern
                               (format "powerline-%s-%s"
                                       powerline-default-separator

                            :background current-line :foreground comment)
        (set-face-attribute 'powerline-inactive2 nil
                            :background background :foreground comment)
        (defface powerline-active3
          `((t (:background ,purple :foreground ,background)))
          "Powerline face 3 (buffer name)"

         "Powerline face 5 (buffer name sans errors)"
         :group 'powerline)))

(defun my-powerline-theme-buffer-face (active)
  "Return the face to use for the buffer name"
  (cond ((not active)
         ;; Gray
         'powerline-inactive3)
        ((and (eq major-mode 'c++-mode)
              (featurep 'rtags)
              (rtags-has-diagnostics))
         ;; Green or red
