]> code.delx.au - gnu-emacs-elpa/commit
swiper.el (swiper-toggle-face-matching): Add and bind to "C-c C-f"
authorOleh Krehel <ohwoeowho@gmail.com>
Wed, 11 Nov 2015 11:01:43 +0000 (12:01 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Wed, 11 Nov 2015 11:01:43 +0000 (12:01 +0100)
commit7cf75750e90f9bb5ad4c61c863330a5f395b80d2
treee438cc9ef4c513b0da61718186aa6636567eb035
parentb39e20cedae2ed3c4dc374479d5baaed1f26b286
swiper.el (swiper-toggle-face-matching): Add and bind to "C-c C-f"

* swiper.el (swiper-map): Bind `swiper-toggle-face-matching' to
  "C-c C-f".
(swiper-invocation-face): New defvar.
(swiper--ivy): Set `swiper-invocation-face'.
(swiper-toggle-face-matching): Toggle `ivy-state-matcher' between
nil (the initial value) and 'swiper--face-matcher.
(swiper--face-matcher): New defun. In addition to filtering CANDIDATES
by having them match REGEXP, also ensure that every match has
`swiper-invocation-face'.

Example of usage:

1. Move point to a variable with e.g. `font-lock-keyword-face' and "C-s"
<input>.

2. Use "C-c C-f" to filter the candidates further by selecting only the
ones that have `font-lock-keyword-face'.
Note that "M-q" (`swiper-query-replace') is also affected by the filtering.

3. Use "C-c C-f" to toggle the filtering off.

Fixes #288
swiper.el