[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/swiper 6f17f80 2/2: Merge branch 'master' into external
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/swiper 6f17f80 2/2: Merge branch 'master' into externals/swiper |
Date: |
Sun, 9 May 2021 11:38:07 -0400 (EDT) |
branch: externals/swiper
commit 6f17f801495aafa17bbb63ca1954046fd8be1a24
Merge: 99ca126 11444e8
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>
Merge branch 'master' into externals/swiper
---
swiper.el | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/swiper.el b/swiper.el
index d57d2bc..7e4f7ed 100644
--- a/swiper.el
+++ b/swiper.el
@@ -1398,24 +1398,20 @@ See `ivy-format-functions-alist' for further
information."
(nreverse cands)))))
(defun swiper--isearch-next-item (re cands)
- (if swiper--isearch-backward
- (or
- (cl-position-if
- (lambda (x)
- (and
- (< x swiper--isearch-start-point)
- (eq 0 (string-match-p
- re
- (buffer-substring-no-properties
- x swiper--isearch-start-point)))))
- cands
- :from-end t)
- 0)
- (or
- (cl-position-if
- (lambda (x) (> x swiper--isearch-start-point))
- cands)
- 0)))
+ (or (if swiper--isearch-backward
+ (save-excursion
+ ;; Match RE starting at each position in CANDS.
+ (setq re (concat "\\=\\(?:" re "\\)"))
+ (cl-position-if
+ (lambda (x)
+ (when (< x swiper--isearch-start-point)
+ (goto-char x)
+ ;; Note: Not quite the same as `looking-at' + `match-end'.
+ (re-search-forward re swiper--isearch-start-point t)))
+ cands
+ :from-end t))
+ (cl-position swiper--isearch-start-point cands :test #'<))
+ 0))
(defun swiper--isearch-filter-ignore-order (re-full cands)
(let (filtered-cands)