4

Coming from helm, I am giving swiper and ivy-mode a shot.

I'm looking for a way to highlight candidates in the way hl-line-mode does: full width background.

hl-line

Mathieu Marques
  • 1,953
  • 1
  • 13
  • 30
  • Is your issue that the entire line is not highlighted but only the text part of the line? – Jules Mar 07 '16 at 14:36
  • Yes exactly. I don't really know how `hl-line` works, but it looks like it uses something else than `:background whatever`. – Mathieu Marques Mar 07 '16 at 14:42
  • It seems like there isn't a very easy way to do this other than looking through the hl-line source code and adding that to highlight the current match in swiper. Maybe you can create an issue on the swiper github? – Jules Mar 07 '16 at 15:17

1 Answers1

2

You probably want:

(setq ivy-format-function 'ivy-format-function-line)
abo-abo
  • 13,943
  • 1
  • 29
  • 43
  • I added a gif to best demonstrate what I am referring to. See how `hl-line` highlight current line (where point is), as opposed to how `swiper` highlight current candidate. I am unable to reproduce `hl-line`'s appearance with `(set-face-attribute 'ivy-current-match nil :background foo)`. – Mathieu Marques Mar 08 '16 at 16:12
  • Nevermind, got it to work with latest `swiper`. Thanks :) – Mathieu Marques Mar 08 '16 at 16:15