Skip to content

Commit

Permalink
Make ivy-switch-buffer-occur work with multi-pass regex builders
Browse files Browse the repository at this point in the history
Fixes #1973
  • Loading branch information
CeleritasCelery authored and abo-abo committed Mar 27, 2019
1 parent 78b62f2 commit 776fbb7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ivy.el
Expand Up @@ -3990,7 +3990,13 @@ Skip buffers that match `ivy-ignore-buffers'."

(defun ivy-switch-buffer-occur ()
"Occur function for `ivy-switch-buffer' using `ibuffer'."
(ibuffer nil (buffer-name) (list (cons 'name ivy--old-re))))
(ibuffer
nil (buffer-name)
`((or ,@(cl-mapcan
(lambda (cand)
(unless (eq (get-text-property 0 'face cand) 'ivy-virtual)
`((name . ,(format "\\_<%s\\_>" (regexp-quote cand))))))
ivy--old-cands)))))

;;;###autoload
(defun ivy-switch-buffer ()
Expand Down

0 comments on commit 776fbb7

Please sign in to comment.