".*?")))))
ivy--regex-hash)))))
+(defun ivy--regex-ignore-order (str)
+ "Re-build regex from STR by splitting it on spaces.
+Ignore the order of each group."
+ (let* ((subs (split-string str " +" t))
+ (len (length subs)))
+ (cl-case len
+ (1
+ (setq ivy--subexps 0)
+ (car subs))
+ (t
+ (setq ivy--subexps len)
+ (let ((all (mapconcat #'identity subs "\\|")))
+ (mapconcat
+ (lambda (x)
+ (if (string-match "^\\\\(.*\\\\)$" x)
+ x
+ (format "\\(%s\\)" x)))
+ (make-list len all)
+ ".*?"))))))
+
(defun ivy--regex-plus (str)
"Build a regex sequence from STR.
Spaces are wild, everything before \"!\" should match.
(setq swiper--opoint (point))
(setq swiper--len 0)
(setq swiper--anchor (line-number-at-pos))
- (setq swiper--window (selected-window)))
+ (setq swiper--window (selected-window))
+ (setq ivy--regex-function
+ (cdr (assoc t ivy-re-builders-alist))))
(defun swiper--ivy (&optional initial-input)
"`isearch' with an overview using `ivy'.
(defun swiper--update-input-ivy ()
"Called when `ivy' input is updated."
(swiper--cleanup)
- (let* ((re (ivy--regex ivy-text))
+ (let* ((re (funcall ivy--regex-function ivy-text))
(str ivy--current)
(num (if (string-match "^[0-9]+" str)
(string-to-number (match-string 0 str))
(goto-char (point-min))
(forward-line (1- (read x)))
(re-search-forward
- (ivy--regex input) (line-end-position) t)
+ (funcall ivy--regex-function input) (line-end-position) t)
(swiper--ensure-visible)
(when (/= (point) swiper--opoint)
(unless (and transient-mark-mode mark-active)