Skip to content

Commit

Permalink
ivy--re-filter-1: Fix string-match-p error
Browse files Browse the repository at this point in the history
  • Loading branch information
kiennq committed Jul 6, 2024
1 parent 3d6c7d9 commit aa64021
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ivy.el
Original file line number Diff line number Diff line change
Expand Up @@ -3642,11 +3642,11 @@ Return result of last form in BODY if it finished successfully."
(unless (booleanp ret) ret))
,@body))

(defun ivy--re-filter (re candidates &optional mkpred)
(defun ivy--re-filter (filter candidates &optional mkpred)
"Like `ivy--re-filter-1' but interruptible by keyboard."
(ivy--while-no-input (ivy--re-filter-1 re candidates mkpred)))
(ivy--while-no-input (ivy--re-filter-1 filter candidates mkpred)))

(defun ivy--re-filter-1 (re candidates &optional mkpred)
(defun ivy--re-filter-1 (filter candidates &optional mkpred)
"Return all CANDIDATES matching FILTER, or nil on error.
FILTER is either a string or a list of (REGEXP . BOOLEAN).
The result includes those CANDIDATES which are matched by each REGEXP
Expand All @@ -3667,7 +3667,7 @@ this function's default regexp matching behavior."
(pred
(if mkpred
(funcall mkpred re)
(lambda (x) (string-match-p re x)))))
(lambda (x) (ignore-errors (string-match-p re x))))))
(setq candidates
(cl-delete nil candidates
(if (cdr matcher) :if-not :if)
Expand Down

0 comments on commit aa64021

Please sign in to comment.