[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6e50ab6 391/399: ivy-test.el (swiper-isearch-backward): Go
From: |
Oleh Krehel |
Subject: |
[elpa] master 6e50ab6 391/399: ivy-test.el (swiper-isearch-backward): Goto old match on DEL |
Date: |
Sat, 20 Jul 2019 14:58:06 -0400 (EDT) |
branch: master
commit 6e50ab636a38d9957e5a70b83ae20ce3dd94376a
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy-test.el (swiper-isearch-backward): Goto old match on DEL
* ivy-test.el (swiper-isearch-backward-backspace): Add test.
Fixes #2125
---
ivy-test.el | 16 ++++++++++++++++
swiper.el | 10 ++++------
2 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/ivy-test.el b/ivy-test.el
index a83e728..c58d1a6 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -1149,6 +1149,22 @@ a buffer visiting a file."
("C-r" "defun\\|defvar" "C-n RET"))
"(defun foo)\nasdf\n(|defvar bar)")))
+(ert-deftest swiper-isearch-backward-backspace ()
+ (should
+ (string=
+ (ivy-with-text
+ "(while (when |))"
+ (global-set-key (kbd "C-r") #'swiper-isearch-backward)
+ ("C-r" "whi" "" "RET"))
+ "(while (|when ))"))
+ (should
+ (string=
+ (ivy-with-text
+ "(while (when |))"
+ (global-set-key (kbd "C-r") #'isearch-backward-regexp)
+ ("C-r" "whi" "" "RET"))
+ "(while (|when ))")))
+
(ert-deftest swiper-isearch-case-fold ()
(should
(string=
diff --git a/swiper.el b/swiper.el
index 4c201a1..123bd9c 100644
--- a/swiper.el
+++ b/swiper.el
@@ -1323,12 +1323,10 @@ come back to the same place as when \"a\" was initially
entered.")
(while (funcall (if swiper--isearch-backward #'re-search-backward
#'re-search-forward) re nil t)
(when (swiper-match-usable-p)
(unless idx-found
- (when (if swiper--isearch-backward
- ;; test if match is before point
- (<= (match-beginning 0) (cdar
swiper--isearch-point-history))
- (or
- ;; test if match is at or after point
- (eq (match-beginning 0) pt-hist)
+ (when (or
+ (eq (match-beginning 0) pt-hist)
+ (if swiper--isearch-backward
+ (<= (match-beginning 0) (cdar
swiper--isearch-point-history))
(>= (match-beginning 0) (cdar
swiper--isearch-point-history))))
(push (cons str (match-beginning 0))
swiper--isearch-point-history)
(setq idx-found idx)))
- [elpa] master 98127be 375/399: ivy.el (ivy-format-functions-alist): Fix defcustom type, (continued)
- [elpa] master 98127be 375/399: ivy.el (ivy-format-functions-alist): Fix defcustom type, Oleh Krehel, 2019/07/20
- [elpa] master 1bb48ae 376/399: swiper.el: Add :group for faces, Oleh Krehel, 2019/07/20
- [elpa] master 3380b6f 382/399: swiper.el (swiper--avy-goto): Works for swiper-isearch, Oleh Krehel, 2019/07/20
- [elpa] master bd53ada 379/399: counsel.el (counsel-async-split-string-re-alist): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 0703a70 380/399: counsel.el (counsel-async-ignore-re-alist): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 59603df 383/399: swiper.el (swiper--avy-goto): Fix for a small amount of cands, Oleh Krehel, 2019/07/20
- [elpa] master 5f030d5 381/399: counsel.el (counsel--git-log-format-function): Add, Oleh Krehel, 2019/07/20
- [elpa] master c4c6068 384/399: doc/ivy.org: Fix RET -> C-j, Oleh Krehel, 2019/07/20
- [elpa] master ee5dacf 385/399: Add swiper-backward command, Oleh Krehel, 2019/07/20
- [elpa] master 3c6790f 387/399: ivy.el (ivy-immediate-done): Improve make-directory, Oleh Krehel, 2019/07/20
- [elpa] master 6e50ab6 391/399: ivy-test.el (swiper-isearch-backward): Goto old match on DEL,
Oleh Krehel <=
- [elpa] master 714911b 389/399: ivy.el (ivy--sort): Higher priority for ivy-sort-matches-functions-alist, Oleh Krehel, 2019/07/20
- [elpa] master 56a1f7d 386/399: Add counsel-grep-backward and counsel-grep-or-swiper-backward commands, Oleh Krehel, 2019/07/20
- [elpa] master 79de883 388/399: ivy.el (ivy--sort): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master f5508e5 390/399: swiper.el (swiper-isearch-backward): Add backward search, Oleh Krehel, 2019/07/20
- [elpa] master af0799a 393/399: counsel.el (counsel-git-log-show-commit-action): Fix match end., Oleh Krehel, 2019/07/20
- [elpa] master 54d1b19 392/399: swiper.el (swiper-isearch-action): Use swiper-action-recenter, Oleh Krehel, 2019/07/20
- [elpa] master 16486d5 394/399: ivy.el (ivy--shorter-matches-first): Add and use for ivy-completion-in-region, Oleh Krehel, 2019/07/20
- [elpa] master f99f13a 396/399: Increase swiper-isearch cursor overlay priority, Oleh Krehel, 2019/07/20
- [elpa] master b5db0aa 397/399: ivy.el (ivy--insert-prompt): Adjust ivy-use-selectable-prompt, Oleh Krehel, 2019/07/20
- [elpa] master 74095a2 395/399: ivy-test.el (swiper-isearch-backward): Test match at point, Oleh Krehel, 2019/07/20