I've noticed that the face selection (of ivy-minibuffer-match-face-X) is not consistently applied, as would be expected. When only a single sub-expression is being matched, ivy-minibuffer-match-face-2 is used (due to the default setting of ivy-use-group-face-if-no-groups), however when 2+ sub-expressions exist, the first sub-expression ends up using ivy-minibuffer-match-face-3 instead, and subsequent sub-expressions use face-4, face-2, etc.
I've attached screenshots demonstrating this issue which shows the face selection when only 1 expression exists vs. 2 or 3 expressions. The minimal configuration performed starting from an emacs -Q standpoint is as follows (also shown in the *scratch* buffer in the attachments):
(require 'package)
(package-initialize)
(require 'swiper)
(progn
(set-face-attribute 'ivy-minibuffer-match-face-2 nil :foreground "white" :background "red")
(set-face-attribute 'ivy-minibuffer-match-face-3 nil :foreground "white" :background "darkgreen")
(set-face-attribute 'ivy-minibuffer-match-face-4 nil :foreground "white" :background "blue")
(set-face-attribute 'swiper-match-face-2 nil :foreground "white" :background "red")
(set-face-attribute 'swiper-match-face-3 nil :foreground "white" :background "darkgreen")
(set-face-attribute 'swiper-match-face-4 nil :foreground "white" :background "blue"))
With the above configuration, I've adjusted both the ivy-minibuffer-match-face-X and swiper-match-face-X background/foreground to use the same colors between the mini-buffer and swiper (for easy comparison...swiper faces are consistently applied) and better differentiate between face-2, face-3 and face-4 usage in the mini-buffer.
With that configuration I just opened the *Faces* buffer (i.e., M-x list-faces-display) and performed the searches as demonstrated in the attachments with Swiper (i.e., M-x swiper).
Based on my experimentation, I've classified the application of the faces as follows:
ivy-minibuffer-match-face-2
- 1st sub-expression in match (when single sub-expression)
- 3rd sub-expression in match (when three sub-expressions)
ivy-minibuffer-match-face-3
- 1st sub-expression in match (when 2 or 3 sub-expressions)
ivy-minibuffer-match-face-4
- 2nd sub-expression in match (when 2 or 3 sub-expressions)
Single sub-expression example (correctly uses ivy-minibuffer-match-face-2):

Two sub-expression example (incorrectly uses ivy-minibuffer-match-face-3 first):

Three sub-expression example (incorrectly uses ivy-minibuffer-match-face-3 first):

I've noticed that the face selection (of
ivy-minibuffer-match-face-X) is not consistently applied, as would be expected. When only a single sub-expression is being matched,ivy-minibuffer-match-face-2is used (due to the default setting ofivy-use-group-face-if-no-groups), however when 2+ sub-expressions exist, the first sub-expression ends up usingivy-minibuffer-match-face-3instead, and subsequent sub-expressions useface-4,face-2, etc.I've attached screenshots demonstrating this issue which shows the face selection when only 1 expression exists vs. 2 or 3 expressions. The minimal configuration performed starting from an
emacs -Qstandpoint is as follows (also shown in the*scratch*buffer in the attachments):With the above configuration, I've adjusted both the
ivy-minibuffer-match-face-Xandswiper-match-face-Xbackground/foreground to use the same colors between the mini-buffer and swiper (for easy comparison...swiper faces are consistently applied) and better differentiate betweenface-2,face-3andface-4usage in the mini-buffer.With that configuration I just opened the
*Faces*buffer (i.e.,M-x list-faces-display) and performed the searches as demonstrated in the attachments with Swiper (i.e.,M-x swiper).Based on my experimentation, I've classified the application of the faces as follows:
ivy-minibuffer-match-face-2ivy-minibuffer-match-face-3ivy-minibuffer-match-face-4Single sub-expression example (correctly uses

ivy-minibuffer-match-face-2):Two sub-expression example (incorrectly uses

ivy-minibuffer-match-face-3first):Three sub-expression example (incorrectly uses

ivy-minibuffer-match-face-3first):